tar and xz files before archiving 39/67939/3
authorSam Hague <shague@redhat.com>
Mon, 5 Feb 2018 23:16:24 +0000 (18:16 -0500)
committerSam Hague <shague@redhat.com>
Tue, 6 Feb 2018 02:39:13 +0000 (21:39 -0500)
Change-Id: Ife5cac7c73b26c6392be46460d509de73b7ee201
Signed-off-by: Sam Hague <shague@redhat.com>
jjb/integration/integration-deploy-openstack-run-test.sh

index 4dc2ce255daa7a049984e499c1d9b0439bd96087..451f9873d616b31a112e9d9d5da9e162fd24cd55 100644 (file)
@@ -496,20 +496,23 @@ EOF
 } # configure_haproxy_for_neutron_requests()
 
 # Collect the list of files on the hosts
-function list_files () {
-    local ip=$1
-    local folder=$2
-    ${SSH} ${ip} "sudo find /etc > /tmp/find.etc.txt"
-    ${SSH} ${ip} "sudo find /opt/stack > /tmp/find.opt.stack.txt"
-    ${SSH} ${ip} "sudo find /var > /tmp/find2.txt"
-    ${SSH} ${ip} "sudo find /var > /tmp/find.var.txt"
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${folder}/rsync.etc.txt
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${folder}/rsync.opt.stack.txt
-    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${folder}/rsync.var.txt
-    scp ${ip}:/tmp/find.etc.txt ${folder}
-    scp ${ip}:/tmp/find.opt.stack.txt ${folder}
-    scp ${ip}:/tmp/find2.txt ${folder}
-    scp ${ip}:/tmp/find.var.txt ${folder}
+function collect_files () {
+    local -r ip=$1
+    local -r folder=$2
+    finddir=/tmp/finder
+    ${SSH} ${ip} "mkdir -p ${finddir}"
+    ${SSH} ${ip} "sudo find /etc > ${finddir}/find.etc.txt"
+    ${SSH} ${ip} "sudo find /opt/stack > ${finddir}/find.opt.stack.txt"
+    ${SSH} ${ip} "sudo find /var > ${finddir}/find2.txt"
+    ${SSH} ${ip} "sudo find /var > ${finddir}/find.var.txt"
+    ${SSH} ${ip} "sudo tar -cJf /tmp/find.tar.xz -C /tmp finder"
+    scp ${ip}:/tmp/find.tar.xz ${folder}
+    mkdir -p ${finddir}
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/etc/ > ${finddir}/rsync.etc.txt
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/opt/stack/ > ${finddir}/rsync.opt.stack.txt
+    rsync --rsync-path="sudo rsync" --list-only -arvhe ssh ${ip}:/var/ > ${finddir}/rsync.var.txt
+    tar -cJf /tmp/rsync.tar.xz -C /tmp finder
+    cp /tmp/rsync.tar.xz ${folder}
 }
 
 function collect_logs () {
@@ -568,7 +571,8 @@ EOF
         scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER}
         ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
         scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
-        rsync -avhe ssh ${!CONTROLLERIP}:/tmp/${BUNDLEFOLDER}/etc ${NODE_FOLDER}
+        ${SSH} ${!CONTROLLERIP} "tar -cJf /tmp/etc.tar.xz -C /tmp/${BUNDLEFOLDER} etc"
+        scp ${!CONTROLLERIP}:/tmp/etc.tar.xz ${NODE_FOLDER}
         ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
         ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
         scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER}
@@ -626,18 +630,20 @@ EOF
         scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
-        list_files "${!OSIP}" "${NODE_FOLDER}"
+        collect_files "${!OSIP}" "${NODE_FOLDER}"
+        ${SSH} ${!OSIP} "sudo tar -cJf /tmp/rabbitmq.tar.xz -C /var/log rabbitmq"
+        scp ${!OSIP}:/tmp/rabbitmq.tar.xz ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone_access.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/httpd/keystone.log ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
-        rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/rabbitmq ${NODE_FOLDER}
         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links
         mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf
-        # qdhcp files are created by robot tests
-        mv /tmp/qdhcp ${NODE_FOLDER}
+        # qdhcp files are created by robot tests and copied into /tmp/qdhcp during the test
+        tar -cJf /tmp/qdhcp.tar.xz -C /tmp qdhcp
+        mv /tmp/qdhcp.tar.xz ${NODE_FOLDER}
         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
     done
 
@@ -664,10 +670,11 @@ EOF
         scp ${!OSIP}:/tmp/ovsdb-tool.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER}
         scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER}
-        list_files "${!OSIP}" "${NODE_FOLDER}"
+        collect_files "${!OSIP}" "${NODE_FOLDER}"
+        ${SSH} ${!OSIP} "sudo tar -cJf /tmp/libvirt.tar.xz -C /var/log libvirt"
+        scp ${!OSIP}:/tmp/libvirt.tar.xz ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER}
-        rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/libvirt ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER}
         rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${NODE_FOLDER}
         rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links