Commit 5a4df77e authored by Sebastien Gougeaud's avatar Sebastien Gougeaud Committed by Thomas Leibovici
Browse files

tests: add a cleanup trap to test_store_retry.sh



This trap consists in shutting down the daemon and dropping the
database tables.

Change-Id: Ibaf7f8c54e6dfd3a4d3beaefe70c4baa6c712f95
Signed-off-by: default avatarSebastien Gougeaud <sebastien.gougeaud@cea.fr>
Reviewed-on: https://cws-fleury.labs.ocre.cea.fr/gerrit/6564


Reviewed-by: Linter
Tested-by: default avatarJenkins s8open_nr <s8open_nr@ccc.ocre.cea.fr>
Reviewed-by: default avatarQuentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: default avatarThomas Leibovici <thomas.leibovici@cea.fr>
parent dcf81acb
#!/bin/sh -e
#!/bin/sh -xe
# -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=4:tabstop=4:
#
# All rights reserved (c) 2014-2020 CEA/DAM.
#
# This file is part of Phobos.
#
# Phobos is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2.1 of the License, or
# (at your option) any later version.
#
# Phobos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Phobos. If not, see <http://www.gnu.org/licenses/>.
test_bin_dir=$(dirname $(readlink -e $0))
. $test_bin_dir/test_env.sh
. $test_bin_dir/setup_db.sh
. $test_bin_dir/test_launch_daemon.sh
function cleanup {
waive_daemon
drop_tables
}
drop_tables
setup_tables
export PHOBOS_LRS_default_family=dir
invoke_daemon
trap cleanup EXIT
$LOG_COMPILER $LOG_FLAGS ./test_store_retry
waive_daemon
if [ -w /dev/changer ]; then
waive_daemon
export PHOBOS_LRS_default_family=tape
invoke_daemon
$LOG_COMPILER $LOG_FLAGS ./test_store_retry
waive_daemon
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment