File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,18 @@ ansible-playbook -v \
110110 tests/playbooks/test-csi-cinder-e2e.yaml
111111exit_code=$?
112112
113+ # Fetch logs for debugging purpose
114+ ansible-playbook -v \
115+ --user ${USERNAME} \
116+ --private-key ~ /.ssh/google_compute_engine \
117+ --inventory ${PUBLIC_IP} , \
118+ --ssh-common-args " -o StrictHostKeyChecking=no" \
119+ tests/playbooks/fetch-logs.yaml
120+
121+ scp -i ~ /.ssh/google_compute_engine \
122+ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
123+ -r ${USERNAME} @${PUBLIC_IP} :~ /logs $ARTIFACTS /logs/devstack || true
124+
113125# Fetch cinder-csi tests logs for debugging purpose
114126scp -i ~ /.ssh/google_compute_engine \
115127 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
Original file line number Diff line number Diff line change @@ -110,6 +110,18 @@ ansible-playbook -v \
110110 tests/playbooks/test-csi-manila-e2e.yaml
111111exit_code=$?
112112
113+ # Fetch logs for debugging purpose
114+ ansible-playbook -v \
115+ --user ${USERNAME} \
116+ --private-key ~ /.ssh/google_compute_engine \
117+ --inventory ${PUBLIC_IP} , \
118+ --ssh-common-args " -o StrictHostKeyChecking=no" \
119+ tests/playbooks/fetch-logs.yaml
120+
121+ scp -i ~ /.ssh/google_compute_engine \
122+ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
123+ -r ${USERNAME} @${PUBLIC_IP} :~ /logs $ARTIFACTS /logs/devstack || true
124+
113125# Fetch manila-csi tests results
114126scp -i ~ /.ssh/google_compute_engine \
115127 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
Original file line number Diff line number Diff line change @@ -113,10 +113,17 @@ ansible-playbook -v \
113113 -e run_e2e=true
114114exit_code=$?
115115
116- # Fetch devstack logs for debugging purpose
117- # scp -i ~/.ssh/google_compute_engine \
118- # -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
119- # -r ${USERNAME}@${PUBLIC_IP}:/opt/stack/logs $ARTIFACTS/logs/devstack || true
116+ # Fetch logs for debugging purpose
117+ ansible-playbook -v \
118+ --user ${USERNAME} \
119+ --private-key ~ /.ssh/google_compute_engine \
120+ --inventory ${PUBLIC_IP} , \
121+ --ssh-common-args " -o StrictHostKeyChecking=no" \
122+ tests/playbooks/fetch-logs.yaml
123+
124+ scp -i ~ /.ssh/google_compute_engine \
125+ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
126+ -r ${USERNAME} @${PUBLIC_IP} :~ /logs $ARTIFACTS /logs/devstack || true
120127
121128# Fetch octavia amphora image build logs for debugging purpose
122129scp -i ~ /.ssh/google_compute_engine \
Original file line number Diff line number Diff line change 1+ - hosts : all
2+ become : true
3+ become_method : sudo
4+ gather_facts : true
5+
6+ vars :
7+ user : stack
8+ devstack_workdir : /home/{{ user }}/devstack
9+
10+ roles :
11+ - role : fetch-logs
Original file line number Diff line number Diff line change 1+ The ansible role gets logs of various services running in the CI for further analysis
Original file line number Diff line number Diff line change 1+ ---
2+ master_port_name : " k3s_master"
Original file line number Diff line number Diff line change 1+ - name : Get k3s master floating IP
2+ shell :
3+ executable : /bin/bash
4+ cmd : |
5+ set +x; source {{ devstack_workdir }}/openrc demo demo > /dev/null
6+ openstack floating ip list --port {{ master_port_name }} -c "Floating IP Address" -f value
7+ register : fip
8+
9+ - name : Set fact for k3s master floating IP
10+ set_fact :
11+ k3s_fip : " {{ fip.stdout }}"
12+
13+ - name : Creates directory
14+ ansible.builtin.file :
15+ path : " /root/logs"
16+ state : directory
17+
18+ - name : Fetch k3s logs
19+ shell :
20+ executable : /bin/bash
21+ cmd : |
22+ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ ansible_user_dir }}/.ssh/id_rsa ubuntu@{{ k3s_fip }} sudo journalctl -u k3s.service --no-pager > /root/logs/k3s.log
23+
24+ - name : Fetch DevStack logs
25+ shell :
26+ executable : /bin/bash
27+ cmd : |
28+ set +x;
29+ units=`systemctl list-units --type service | awk '{ print $1 }' | grep devstack\@`
30+ for unit in $units; do
31+ filename=${unit#"devstack@"}
32+ filename=${filename%".service"}
33+ sudo journalctl -u $unit --no-pager > /root/logs/${filename}.log
34+ done;
You can’t perform that action at this time.
0 commit comments