GITHUB_STATUS_STATE="failure" $VENV/github-status create
-cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+CEPH_VOLUME_FUNCTIONAL_TESTS_PATH=$WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+COLLECT_LOGS_PLAYBOOK_PATH="$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH/$SUBCOMMAND/.tox/${DISTRO}-${OBJECTSTORE}-${SCENARIO}/tmp/ceph-ansible/tests/functional/collect-logs.yml"
+cd "$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH"
# the method exists in scripts/build_utils.sh
-teardown_vagrant_tests $VENV
+teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH"
# for every Vagrantfile in scenarios and then just destroys whatever is left.
-cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+CEPH_VOLUME_FUNCTIONAL_TESTS_PATH=$WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+COLLECT_LOGS_PLAYBOOK_PATH="$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH/$SUBCOMMAND/.tox/${DISTRO}-${OBJECTSTORE}-${SCENARIO}/tmp/ceph-ansible/tests/functional/collect-logs.yml"
+cd "$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH"
TEMPVENV=$(create_venv_dir)
VENV=${TEMPVENV}/bin
# the method exists in scripts/build_utils.sh
-teardown_vagrant_tests $VENV
+teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH"
\ No newline at end of file
#!/bin/bash
-cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+CEPH_VOLUME_FUNCTIONAL_TESTS_PATH=$WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
+COLLECT_LOGS_PLAYBOOK_PATH="$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH/$SUBCOMMAND/.tox/${DISTRO}-${OBJECTSTORE}-${SCENARIO}/tmp/ceph-ansible/tests/functional/collect-logs.yml"
+cd "$CEPH_VOLUME_FUNCTIONAL_TESTS_PATH"
TEMPVENV=$(create_venv_dir)
VENV=${TEMPVENV}/bin
# the method exists in scripts/build_utils.sh
-teardown_vagrant_tests $VENV
+teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH"
collect_ceph_logs() {
local venv=$1
- shift
# this is meant to be run in a testing scenario directory
# with running vagrant vms. the ansible playbook will connect
# to your test nodes and fetch any ceph logs that are present
# in /var/log/ceph and store them on the jenkins builder.
# these logs can then be archived using the JJB archive publisher
- limit=$1
+
+ if [ -n "$2" ]; then
+ # set playbook path to overridden path
+ COLLECT_LOGS_PLAYBOOK_PATH="$2"
+ else
+ # set playbook path to default path
+ COLLECT_LOGS_PLAYBOOK_PATH="$WORKSPACE/tests/functional/collect-logs.yml"
+ fi
if [ -f "./vagrant_ssh_config" ]; then
mkdir -p $WORKSPACE/logs
export ANSIBLE_SSH_ARGS='-F ./vagrant_ssh_config'
export ANSIBLE_STDOUT_CALLBACK='debug'
export ANSIBLE_ROLES_PATH=$WORKSPACE/roles
- $venv/ansible-playbook -vv -i hosts --limit $limit --extra-vars "archive_path=$WORKSPACE/logs" "$WORKSPACE/tests/functional/collect-logs.yml" || true
+ $venv/ansible-playbook -vv -i hosts --limit all --extra-vars "archive_path=$WORKSPACE/logs" "${COLLECT_LOGS_PLAYBOOK_PATH}" || true
fi
}
teardown_vagrant_tests() {
local venv=$1
- shift
+ local collect_logs_playbook_path=$2
# collect ceph logs and teardown any running vagrant vms
# this also cleans up any lingering livirt networks
for scenario in $scenarios; do
cd $scenario
# collect all ceph logs from all test nodes
- collect_ceph_logs $venv all
+ collect_ceph_logs "$venv" "$collect_logs_playbook_path"
vagrant destroy -f
stat ./fetch > /dev/null 2>&1 && rm -rf ./fetch
cd -