Skip to content

Commit

Permalink
Name the test tools contest
Browse files Browse the repository at this point in the history
Signed-off-by: utam0k <k0ma@utam0k.jp>
  • Loading branch information
utam0k committed Oct 29, 2023
1 parent ba4a10f commit 8dc21b1
Show file tree
Hide file tree
Showing 78 changed files with 64 additions and 6,340 deletions.
File renamed without changes.
4 changes: 1 addition & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ jobs:
name: youki
- name: Add the permission to run
run: chmod +x ./youki
- name: Build
run: just runtimetest rust-oci-tests-bin
- name: Validate tests on youki
run: just rust-oci-tests
run: just run-contest

rootless-podman-test:
runs-on: ubuntu-22.04
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.idea/

**/target
/runtimetest-target
/contest-target
/bin
.vagrant/

Expand All @@ -11,7 +11,7 @@ tags.lock
tags.temp

/youki
/integration_test
/contest
/runtimetest

.vscode
Expand All @@ -21,4 +21,4 @@ tags.temp
/bundle.tar.gz
/test.log

/tests/k8s/_out/
/e2e/k8s/_out/
8 changes: 3 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[submodule "integration_tests/oci-runtime-tests"]
path = tests/oci-runtime-tests/src/github.com/opencontainers/runtime-tools
url = https://github.com/opencontainers/runtime-tools.git
ignore = dirty

[submodule "e2e/oci-runtime-tests/src/github.com/opencontainers/runtime-tools"]
path = e2e/oci-runtime-tests/src/github.com/opencontainers/runtime-tools
url = ttps://github.com/opencontainers/runtime-tools.git
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["tests/runtimetest/","tests/integration_test/","tests/test_framework/","crates/*", "tools/*"]
members = ["crates/*", "contest/*", "tools/*"]

[profile.release]
lto = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule runtime-tools added at 408c51
File renamed without changes.
27 changes: 12 additions & 15 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@ alias youki := youki-dev
KIND_CLUSTER_NAME := 'youki'

cwd := justfile_directory()
bin_dir := justfile_directory() / "bin"

# build

# build all binaries
build-all: youki-release rust-oci-tests-bin runtimetest
build-all: youki-release contest

# build youki in dev mode
youki-dev:
{{ cwd }}/scripts/build.sh -o {{ cwd }} -c youki
{{ cwd }}/scripts/build.sh -o {{ bin_dir }} -c youki

# build youki in release mode
youki-release:
{{ cwd }}/scripts/build.sh -o {{ cwd }} -r -c youki
{{ cwd }}/scripts/build.sh -o {{ bin_dir }} -r -c youki

# build runtimetest binary
runtimetest:
{{ cwd }}/scripts/build.sh -o {{ cwd }} -r -c runtimetest

# build rust oci tests binary
rust-oci-tests-bin:
{{ cwd }}/scripts/build.sh -o {{ cwd }} -r -c integration-test
# build contest
contest:
{{ cwd }}/scripts/build.sh -o {{ bin_dir }}/ -r -c contest

# Tests

# run integration tests
test-integration: test-oci rust-oci-tests
test-integration: test-oci run-contest

# run all tests except rust-oci
test-all: test-basic test-features test-oci containerd-test # currently not doing rust-oci here
Expand All @@ -55,14 +52,14 @@ test-musl:

# run oci integration tests through runtime-tools
test-oci:
{{ cwd }}/scripts/oci_integration_tests.sh {{ cwd }}
{{ cwd }}/scripts/oci_integration_tests.sh {{ bin_dir }}

# run rust oci integration tests
rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
{{ cwd }}/scripts/rust_integration_tests.sh {{ cwd }}/youki
run-contest: youki-release contest
{{ cwd }}/scripts/contest.sh {{ bin_dir }}/youki

# validate rust oci integration tests on runc
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
validate-contest-runc: contest
{{ cwd }}/scripts/rust_integration_tests.sh runc

# test podman rootless works with youki
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
profile="default"
channel="1.72.0"
channel="1.73.0"
22 changes: 9 additions & 13 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ usage_exit() {
VERSION=debug
TARGET="$(uname -m)-unknown-linux-gnu"
CRATE="youki"
RUNTIMETEST_TARGET="$ROOT/runtimetest-target"
features=""
while getopts f:ro:c:h OPT; do
case $OPT in
Expand Down Expand Up @@ -49,21 +48,18 @@ OUTPUT=${output:-$ROOT/bin}


if [ "$CRATE" == "youki" ]; then
rm -f ${OUTPUT}/youki
find ${OUTPUT} -maxdepth 1 -type f -name "youki" -exec rm -ifv {} \;
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin youki
mv ${ROOT}/target/${TARGET}/${VERSION}/youki ${OUTPUT}/
fi

if [ "$CRATE" == "integration-test" ]; then
rm -f ${OUTPUT}/integration_test
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin integration_test
mv ${ROOT}/target/${TARGET}/${VERSION}/integration_test ${OUTPUT}/
fi
if [ "$CRATE" == "contest" ]; then
find ${OUTPUT} -maxdepth 1 -type f -name "contest" -exec rm -ifv {} \;
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin contest
mv ${ROOT}/target/${TARGET}/${VERSION}/contest ${OUTPUT}/

if [ "$CRATE" == "runtimetest" ]; then
rm -f ${OUTPUT}/runtimetest
CARGO_TARGET_DIR=${RUNTIMETEST_TARGET} RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin runtimetest
mv ${RUNTIMETEST_TARGET}/${TARGET}/${VERSION}/runtimetest ${OUTPUT}/
find ${OUTPUT} -maxdepth 1 -type f -name "runtimetest" -exec rm -ifv {} \;
CONTEST_TARGET="$ROOT/contest-target"
CARGO_TARGET_DIR=${CONTEST_TARGET} RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin runtimetest
mv ${CONTEST_TARGET}/${TARGET}/${VERSION}/runtimetest ${OUTPUT}/
fi

exit 0
5 changes: 3 additions & 2 deletions scripts/rust_integration_tests.sh → scripts/contest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ ROOT=${2-$(git rev-parse --show-toplevel)}
LOGFILE="${ROOT}/test.log"

if [ ! -f ${ROOT}/bundle.tar.gz ]; then
cp ${ROOT}/tests/integration_test/bundle.tar.gz ${ROOT}/bundle.tar.gz
cp ${ROOT}/contest/contest/bundle.tar.gz ${ROOT}/bundle.tar.gz
fi
touch ${LOGFILE}

sudo ${ROOT}/integration_test run --runtime "$RUNTIME" --runtimetest ${ROOT}/runtimetest > $LOGFILE
# TOOD
sudo ${ROOT}/bin/contest run --runtime "$RUNTIME" --runtimetest ${ROOT}/bin/runtimetest > $LOGFILE

if [ 0 -ne $(grep "not ok" $LOGFILE | wc -l ) ]; then
cat $LOGFILE
Expand Down
1 change: 0 additions & 1 deletion tests/integration_test/.gitignore

This file was deleted.

37 changes: 0 additions & 37 deletions tests/integration_test/Cargo.toml

This file was deleted.

79 changes: 0 additions & 79 deletions tests/integration_test/README.md

This file was deleted.

Binary file removed tests/integration_test/bundle.tar.gz
Binary file not shown.
3 changes: 0 additions & 3 deletions tests/integration_test/src/lib.rs

This file was deleted.

Loading

0 comments on commit 8dc21b1

Please sign in to comment.