From ca28815accb4e4250e7d805ca0f02af670d12303 Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Tue, 12 Nov 2019 16:29:01 +0530 Subject: [PATCH] Collect openstack services logs after tempest run Currently in packstack deployment, we are collecting logs once the deployment finishes and then we run tempest tests and collect tempest related logs. If the tempest tests fails, we have no openstack services logs with tempest api calls in service logs, it is very hard to find out what is causing the failure. Copying the openstack services logs just after tempest runs finishes will more info about the failure. It also disables the copy log operation once packstack deployment finishes. Change-Id: I5ab038a49eeabe564650894f50c3b51e33e93fd2 Signed-off-by: Chandan Kumar (raukadah) --- playbooks/python-tempestconf-tempest-packstack.yaml | 5 ++++- playbooks/upload-logs.yaml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/playbooks/python-tempestconf-tempest-packstack.yaml b/playbooks/python-tempestconf-tempest-packstack.yaml index 1ecc3396..c4213bf7 100644 --- a/playbooks/python-tempestconf-tempest-packstack.yaml +++ b/playbooks/python-tempestconf-tempest-packstack.yaml @@ -2,11 +2,14 @@ vars: test_demo_user: "{{ test_demo is defined }}" tasks: + # Disable packstack logs copy once packstack deployment finishes # packstack-integration-tempest role is inherited from # x/packstack project - name: Install packstack allinone - include_role: + import_role: name: packstack-integration-tempest + environment: + COPY_LOGS: false # setup-tempest-user, setup-stack-user and setup-devstack-source-dirs # are inherited from openstack/devstack - name: Setup Stack user diff --git a/playbooks/upload-logs.yaml b/playbooks/upload-logs.yaml index 5096e6ba..17b31a6b 100644 --- a/playbooks/upload-logs.yaml +++ b/playbooks/upload-logs.yaml @@ -1,5 +1,17 @@ - hosts: all tasks: + # Copy openstack logs once tempest run finishes + - name: Copy openstack services logs once tempest run finish + shell: + cmd: | + set -e + set -x + source ./tools/copy-logs.sh + recover_default_logs + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace/packstack' + environment: '{{ zuul }}' + - name: Create tempest directory in /tmp/logs file: path: /tmp/logs/tempest