Skip to content

Commit

Permalink
ci: Test full-emulation cosa run
Browse files Browse the repository at this point in the history
We should have some CI that verifies this works.
  • Loading branch information
cgwalters committed Nov 30, 2022
1 parent 5cf1cfd commit 3d5071f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def cpuCount_s = cpuCount.toString()
def imageName = buildImage(env: [ENABLE_GO_RACE_DETECTOR: "1", GOMAXPROCS: cpuCount_s], cpu: cpuCount_s)

def memory = (cpuCount * 1536) as Integer
parallel build: {
pod(image: imageName + ":latest", kvm: true, cpu: "${cpuCount}", memory: "${memory}Mi") {
checkout scm

Expand Down Expand Up @@ -52,6 +53,7 @@ pod(image: imageName + ":latest", kvm: true, cpu: "${cpuCount}", memory: "${memo
utils.cosaCmd(cosaDir: "/srv", args: "buildupload --dry-run s3 --acl=public-read my-nonexistent-bucket/my/prefix")
}


// Random other tests that aren't about building. XXX: These should be part of `make
// check` or something and use dummy cosa builds.
stage("CLI Tests") {
Expand All @@ -61,3 +63,12 @@ pod(image: imageName + ":latest", kvm: true, cpu: "${cpuCount}", memory: "${memo
""")
}
}
}, selftests: {
pod(image: imageName + ":latest", kvm: true, cpu: "${cpuCount}", memory: "4096Mi") {
checkout scm

stage("cosa run tests") {
shwrap("./tests/test-cosa-run.sh")
}
}
}
11 changes: 11 additions & 0 deletions tests/test-cosa-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# This verifies e.g. `cosa run`.
set -xeuo pipefail
tmpdir=$(mktemp -d -p /var/tmp)
cd ${tmpdir}
coreos-installer download -a s390x -p qemu -f qcow2.xz --decompress
cosa run --arch s390x *.qcow2 -x "cat /proc/cpuinfo" > cpuinfo.txt
grep -F 'IBM/S390' cpuinfo.txt
cd -
rm "${tmpdir}" -rf
echo "ok cosa run full emulation"

0 comments on commit 3d5071f

Please sign in to comment.