Skip to content

Commit eaae288

Browse files
committed
ci: debug
Signed-off-by: Ray Lee <hburaylee@gmail.com>
1 parent 09e6c66 commit eaae288

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 5
1213

1314
steps:
1415
- name: Checkout code
@@ -19,7 +20,7 @@ jobs:
1920
- name: Install dependencies
2021
run: |
2122
sudo apt-get update
22-
sudo apt-get install -y build-essential qemu-system python3
23+
sudo apt-get install -y build-essential python3 qemu-system-x86
2324
2425
- name: Check QEMU availability
2526
run: |
@@ -38,6 +39,8 @@ jobs:
3839
file kvm-dmesg
3940
4041
- name: Run full tests
42+
env:
43+
CI: "true"
4144
run: |
4245
set -x # Enable verbose output
4346
cd tests
@@ -60,7 +63,7 @@ jobs:
6063
fi
6164
6265
# Run the test script and capture exit code
63-
bash -x base.sh
66+
timeout 180s bash -x base.sh
6467
TEST_EXIT_CODE=$?
6568
6669
echo "Full test script exited with code: $TEST_EXIT_CODE"

tests/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ def qemu_run(vmlinux_path):
119119
'-kernel', vmlinux_path,
120120
'-nographic',
121121
'-no-reboot',
122-
'-append', 'console=ttyS0',
122+
'-append', 'console=ttyS0,115200 earlycon=serial,ttyS0,115200',
123123
'-m', '4G',
124124
'-smp', '1',
125125
'-qmp', 'unix:/tmp/qmp.sock,server,nowait',
126126
'-monitor', 'unix:/tmp/mon.sock,server,nowait'
127127
]
128128

129-
if os.path.exists('/dev/kvm'):
129+
if os.path.exists('/dev/kvm') and os.environ.get('CI') != 'true':
130130
command.extend(['-accel', 'kvm', '-cpu', 'host'])
131131

132132
try:
@@ -145,7 +145,7 @@ def qemu_run(vmlinux_path):
145145
print("\nKernel booted successfully!")
146146
return True
147147

148-
print("\nKernel did not boot successfully.")
148+
print("\n" + Colors.RED + "Kernel did not boot successfully." + Colors.ENDC)
149149
process.terminate()
150150
return False
151151

tests/base.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [ ! -d kvm-dmesg-ci ]; then
2222
git clone git@github.com:rayylee/kvm-dmesg-ci.git -b master ||
2323
git clone https://github.com/rayylee/kvm-dmesg-ci -b master
2424
fi
25+
26+
/bin/qemu-system-x86_64 -kernel kvm-dmesg-ci/kernels/el10/vmlinuz-6.11.0-25.el10.x86_64 -nographic -no-reboot -append console=ttyS0 -m 4G -smp 1 -qmp unix:/tmp/qmp.sock,server,nowait -monitor unix:/tmp/mon.sock,server,nowait
27+
2528
python3 base.py
2629

2730
exit 0

0 commit comments

Comments
 (0)