From: Guillaume Abrioux Date: Fri, 16 Sep 2022 09:12:29 +0000 (+0200) Subject: Revert "build_utils: fix collect_ceph_logs function" X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cfcf32c023190e72fc1bb92da9773464f53885ed;p=ceph-build.git Revert "build_utils: fix collect_ceph_logs function" This reverts commit 14f91f9d7a2b2bd9ca17cc1a89b5a48191e46d1f. Signed-off-by: Guillaume Abrioux --- diff --git a/ceph-volume-ansible-prs/build/teardown b/ceph-volume-ansible-prs/build/teardown index b817bee8..11e3bbcf 100644 --- a/ceph-volume-ansible-prs/build/teardown +++ b/ceph-volume-ansible-prs/build/teardown @@ -10,9 +10,7 @@ install_python_packages $TEMPVENV "pkgs[@]" GITHUB_STATUS_STATE="failure" $VENV/github-status create -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" +cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional # the method exists in scripts/build_utils.sh -teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH" +teardown_vagrant_tests $VENV diff --git a/ceph-volume-nightly/build/teardown b/ceph-volume-nightly/build/teardown index 205bd349..4735815d 100644 --- a/ceph-volume-nightly/build/teardown +++ b/ceph-volume-nightly/build/teardown @@ -3,11 +3,9 @@ # for every Vagrantfile in scenarios and then just destroys whatever is left. -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" +cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional TEMPVENV=$(create_venv_dir) VENV=${TEMPVENV}/bin # the method exists in scripts/build_utils.sh -teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH" \ No newline at end of file +teardown_vagrant_tests $VENV diff --git a/ceph-volume-scenario/build/teardown b/ceph-volume-scenario/build/teardown index dbd8c494..793b3aab 100644 --- a/ceph-volume-scenario/build/teardown +++ b/ceph-volume-scenario/build/teardown @@ -1,10 +1,8 @@ #!/bin/bash -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" +cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional TEMPVENV=$(create_venv_dir) VENV=${TEMPVENV}/bin # the method exists in scripts/build_utils.sh -teardown_vagrant_tests "$VENV" "$COLLECT_LOGS_PLAYBOOK_PATH" +teardown_vagrant_tests $VENV diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 39156818..3b5b9085 100755 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -1280,19 +1280,13 @@ github_status_setup() { 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 - - 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 + limit=$1 if [ -f "./vagrant_ssh_config" ]; then mkdir -p $WORKSPACE/logs @@ -1303,13 +1297,13 @@ collect_ceph_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 all --extra-vars "archive_path=$WORKSPACE/logs" "${COLLECT_LOGS_PLAYBOOK_PATH}" || true + $venv/ansible-playbook -vv -i hosts --limit $limit --extra-vars "archive_path=$WORKSPACE/logs" "$WORKSPACE/tests/functional/collect-logs.yml" || true fi } teardown_vagrant_tests() { local venv=$1 - local collect_logs_playbook_path=$2 + shift # collect ceph logs and teardown any running vagrant vms # this also cleans up any lingering livirt networks @@ -1318,7 +1312,7 @@ teardown_vagrant_tests() { for scenario in $scenarios; do cd $scenario # collect all ceph logs from all test nodes - collect_ceph_logs "$venv" "$collect_logs_playbook_path" + collect_ceph_logs $venv all vagrant destroy -f stat ./fetch > /dev/null 2>&1 && rm -rf ./fetch cd -