]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Revert "build_utils: fix collect_ceph_logs function"
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 16 Sep 2022 09:12:29 +0000 (11:12 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 16 Sep 2022 09:12:29 +0000 (11:12 +0200)
This reverts commit 14f91f9d7a2b2bd9ca17cc1a89b5a48191e46d1f.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
ceph-volume-ansible-prs/build/teardown
ceph-volume-nightly/build/teardown
ceph-volume-scenario/build/teardown
scripts/build_utils.sh

index b817bee828120b307f09cfbd7d271fa6282dbcf3..11e3bbcf1eda32b02edf154020ad985598f03db6 100644 (file)
@@ -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
index 205bd349a0d9a5b3fcfd5c59e9669d6e0b54869a..4735815d6cfa3ddaa27ce0c32a82eb533521c2d3 100644 (file)
@@ -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
index dbd8c4943ff7dc18fa9a32f2b27cdc700a1492ac..793b3aab34dcdf33e7660d7b27b56f8ee74f919d 100644 (file)
@@ -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
index 39156818dec3217f5425be1a4d61a5595ddffa63..3b5b90853c5ba1a82ecc2bafa1107f79736d3769 100755 (executable)
@@ -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 -