File tree Expand file tree Collapse file tree 3 files changed +37
-22
lines changed Expand file tree Collapse file tree 3 files changed +37
-22
lines changed Original file line number Diff line number Diff line change
1
+ name : emergency-debugging
2
+ description : Store debugging information in case of test failure
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Obtain logs from test runner
7
+ shell : bash
8
+ run : |
9
+ cp /var/log/libvirt/qemu/*.log . || true
10
+ journalctl --no-pager > journal.log || true
11
+
12
+ - name : Obtain logs from hypervisors
13
+ shell : bash
14
+ run : |
15
+ KEY=/opt/ssh_host_ed25519_key
16
+ SSH_OPTS="-i $KEY -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
17
+ USER="root"
18
+ HV1_IP="192.168.122.2"
19
+ HV2_IP="192.168.122.3"
20
+
21
+ ssh $SSH_OPTS $USER@$HV1_IP "journalctl --no-pager" > "journal-HV1.log" || true
22
+ scp $SSH_OPTS $USER@$HV1_IP:/var/log/libvirt/qemu/VM-QEMU.log "VM-QEMU-HV1.log" || true
23
+ scp $SSH_OPTS $USER@$HV1_IP:/var/log/libvirt/ch/VM-CHV.log "VM-CHV-HV1.log" || true
24
+
25
+ ssh $SSH_OPTS $USER@$HV2_IP "journalctl --no-pager" > "journal-HV2.log" || true
26
+ scp $SSH_OPTS $USER@$HV2_IP:/var/log/libvirt/qemu/VM-QEMU.log "VM-QEMU-HV2.log" || true
27
+ scp $SSH_OPTS $USER@$HV2_IP:/var/log/libvirt/ch/VM-CHV.log "VM-CHV-HV2.log" || true
28
+
29
+ - name : Upload artifacts
30
+ uses : actions/upload-artifact@v4
31
+ with :
32
+ name : debug-logs
33
+ path : *.log
34
+
Original file line number Diff line number Diff line change @@ -130,25 +130,3 @@ runs:
130
130
sleep 10
131
131
done
132
132
EOF
133
-
134
- - name : Clean up HyperVisors
135
- shell : bash
136
- run : |
137
- KEY=/opt/ssh_host_ed25519_key
138
- SSH_OPTS="-i $KEY -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
139
- USER="root"
140
- IP_HV1="192.168.122.2"
141
- IP_HV2="192.168.122.3"
142
-
143
- cleanup() {
144
- local IP="$1"
145
- ssh $SSH_OPTS "$USER@$IP" << EOF
146
- virsh destroy VM-QEMU || true
147
- virsh undefine VM-QEMU --nvram --tpm --remove-all-storage
148
- rm -f /var/lib/libvirt/images/ubuntu.qcow2
149
- rm -f /opt/vm-qemu.xml
150
- EOF
151
- }
152
-
153
- cleanup "$IP_HV1"
154
- cleanup "$IP_HV2"
Original file line number Diff line number Diff line change 40
40
uses : ./.github/actions/test/integration/test/qemu
41
41
- name : Test CloudHypervisor
42
42
uses : ./.github/actions/test/integration/test/cloudhypervisor
43
+ - name : Emergency Debugging
44
+ if : failure()
45
+ uses : ./.github/actions/test/integration/emergency-debugging
You can’t perform that action at this time.
0 commit comments