Skip to content

Commit

Permalink
CI: add virtio-serial build and integration test
Browse files Browse the repository at this point in the history
Signed-off-by: Jiaqi Gao <[email protected]>
  • Loading branch information
gaojiaqi7 authored and jyao1 committed Jul 21, 2023
1 parent 9255ac1 commit 623309f
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 75 deletions.
74 changes: 71 additions & 3 deletions .github/workflows/integration-tdx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ env:
TOOLCHAIN_PROFILE: minimal

jobs:
system_compile:
name: Run TDX Integration Test
virtio_vsock:
name: Run TDX Integration Test (virtio-vsock)
runs-on: [self-hosted, tdx]
# timeout-minutes: 30

Expand Down Expand Up @@ -99,4 +99,72 @@ jobs:
- name: Run Tests - Run migration test case 011
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_011.bin
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_011.bin
virtio_serial:
name: Run TDX Integration Test (virtio-serial)
runs-on: [self-hosted, tdx]

steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive

- name: Build Migration TD binary
run: bash sh_script/build_final.sh -t migtd -d serial -c -a on

- name: Run Tests - Test Migration TD
run: |
sudo bash sh_script/integration_tdx.sh -f target/release/migtd.bin -d serial
- name: Run Tests - Cycle Test Migration TD (20)
run: |
sudo bash sh_script/integration_tdx.sh -f target/release/migtd.bin -d serial -n 20
- name: Build all test binaries
run: bash sh_script/build_final.sh -t test -c -a on -d serial

- name: Run Tests - Run migration test case 001
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_001.bin -d serial
- name: Run Tests - Run migration test case 002
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_002.bin -d serial
- name: Run Tests - Run migration test case 003
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_003.bin -d serial
- name: Run Tests - Run migration test case 004
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_004.bin -d serial
- name: Run Tests - Run migration test case 005
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_005.bin -d serial
- name: Run Tests - Run migration test case 006
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_006.bin -d serial
- name: Run Tests - Run migration test case 007
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_007.bin -d serial
- name: Run Tests - Run migration test case 008
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_008.bin -d serial
- name: Run Tests - Run migration test case 009
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_009.bin -d serial
- name: Run Tests - Run migration test case 010
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_010.bin -d serial
- name: Run Tests - Run migration test case 011
run: |
sudo bash sh_script/integration_tdx.sh -f Bin/migtd_011.bin -d serial
54 changes: 52 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
TOOLCHAIN_PROFILE: minimal

jobs:
system_compile:
build_migtd:
name: Build final migtd
runs-on: ubuntu-20.04
timeout-minutes: 30
Expand Down Expand Up @@ -60,4 +60,54 @@ jobs:
run: bash sh_script/build_final.sh -t migtd -c -a on

- name: Build Migtd Final Binary Using Vmcall-Vsock
run: bash sh_script/build_final.sh -t migtd -v vmcall -c
run: bash sh_script/build_final.sh -t migtd -d vmcall -c

- name: Build Migtd Final Binary Using virtio-serial
run: bash sh_script/build_final.sh -t migtd -d serial -c

build_migtd_features:
name: Build final migtd (vmcall-vsock/virtio-serial)
runs-on: ubuntu-20.04
timeout-minutes: 30

steps:
# Install first since it's needed to build NASM
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
directory: ${{ runner.temp }}/llvm

- name: Install NASM
uses: ilammy/setup-nasm@v1

- name: Install tools for sgx lib
run: sudo apt-get install build-essential ocaml ocamlbuild automake autoconf libtool wget python-is-python3 libssl-dev git cmake perl

- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rust-src

- name: Run cargo install cargo-xbuild
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-xbuild

- name: Preparation Work
run: bash sh_script/preparation.sh

- name: Build Migtd Final Binary Using Vmcall-Vsock
run: bash sh_script/build_final.sh -t migtd -d vmcall -c

- name: Build Migtd Final Binary Using virtio-serial
run: bash sh_script/build_final.sh -t migtd -d serial -c
17 changes: 8 additions & 9 deletions sh_script/build_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function cleanup() {
}

function proccess_args() {
while getopts ":t:a:v:c" option; do
while getopts ":t:a:v:d:c" option; do
case "${option}" in
t) type=${OPTARG};;
a) attestation=${OPTARG};;
v) vsock=${OPTARG};;
d) device=${OPTARG};;
c) cleanup;;
esac
done
Expand All @@ -45,13 +45,12 @@ function proccess_args() {
then
MIGTD_FEATURE+=",remote-attestation"
fi

if [[ ${vsock} == "vmcall" ]];
then
MIGTD_FEATURE+=",vmcall-vsock"
else
MIGTD_FEATURE+=",virtio-vsock"
fi

case "${device}" in
vmcall) MIGTD_FEATURE+=",vmcall-vsock";;
serial) MIGTD_FEATURE+=",virtio-serial";;
*) MIGTD_FEATURE+=",virtio-vsock";;
esac
}

function check_file_exist() {
Expand Down
Loading

0 comments on commit 623309f

Please sign in to comment.