Running regression test in ci

This commit is contained in:
Jianfeng Jiang
2023-11-02 17:37:21 +08:00
committed by Tate, Hongliang Tian
parent af81741f23
commit d24775001f
7 changed files with 40 additions and 12 deletions

View File

@ -28,6 +28,10 @@ jobs:
id: syscall_test_linux
run: make run AUTO_TEST=syscall ENABLE_KVM=0 BOOT_PROTOCOL=linux RELEASE_MODE=1
- name: Regression Test (Linux Boot Portocol)
id: regression_test_linux
run: make run AUTO_TEST=regression ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 RELEASE_MODE=1
- name: Syscall Test (MicroVM)
id: syscall_test_microvm
run: make run AUTO_TEST=syscall ENABLE_KVM=0 BOOT_METHOD=microvm RELEASE_MODE=1

View File

@ -22,6 +22,9 @@ ifeq ($(AUTO_TEST), syscall)
BUILD_SYSCALL_TEST := 1
INIT_CMDLINE += /opt/syscall_test/run_syscall_test.sh
endif
ifeq ($(AUTO_TEST), regression)
INIT_CMDLINE += /regression/run_regression_test.sh
endif
ifeq ($(AUTO_TEST), boot)
INIT_CMDLINE += -c exit 0
endif

View File

@ -94,6 +94,15 @@ cargo component-check
### Integration Test
#### Regression Test
This command will automatically run Jinux with the test binaries in `regression/apps` directory.
```bash
make run AUTO_TEST=regression
```
#### Syscall Test
This command will build the syscall test binary and automatically run Jinux with the tests using QEMU.
```bash
make run AUTO_TEST=syscall

View File

@ -1,8 +1,10 @@
#!/bin/sh
set -e
NETTEST_DIR=/regression/network
cd ${NETTEST_DIR}
echo "Start net test......"
echo "Start network test......"
./tcp_server &
./tcp_client
./udp_server &
@ -11,4 +13,4 @@ echo "Start net test......"
./unix_client
./socketpair
echo "All net test passed"
echo "All network test passed"

View File

@ -5,11 +5,11 @@ set -e
SCRIPT_DIR=/regression
cd ${SCRIPT_DIR}/..
echo "Running tests......"
echo "Start process test......"
tests="hello_world/hello_world fork/fork execve/execve fork_c/fork signal_c/signal_test pthread/pthread_test hello_pie/hello pty/open_pty"
for testcase in ${tests}
do
echo "Running test ${testcase}......"
${SCRIPT_DIR}/${testcase}
done
echo "All tests passed"
echo "All process test passed."

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
SCRIPT_DIR=/regression
cd ${SCRIPT_DIR}
./shell_cmd.sh
./process.sh
./network.sh

View File

@ -10,23 +10,23 @@ touch hello.txt
mv hello.txt hello_world.txt
rm hello_world.txt
awk '{print $2}' test_cmd.sh
cp test_cmd.sh test_cmd_backup.sh
cat test_cmd_backup.sh
rm test_cmd_backup.sh
awk '{print $2}' shell_cmd.sh
cp shell_cmd.sh shell_cmd_backup.sh
cat shell_cmd_backup.sh
rm shell_cmd_backup.sh
ln -s test_cmd.sh tesk_cmd_soft_link
ln -s shell_cmd.sh tesk_cmd_soft_link
readlink -f tesk_cmd_soft_link
tail -n 1 tesk_cmd_soft_link
rm tesk_cmd_soft_link
ln test_cmd.sh tesk_cmd_hard_link
ln shell_cmd.sh tesk_cmd_hard_link
tail -n 1 tesk_cmd_hard_link
unlink tesk_cmd_hard_link
sed 3q test_cmd.sh
sed 3q shell_cmd.sh
find . -name "*test_cmd*"
find . -name "*shell_cmd*"
mkdir foo
rmdir foo