test: add provisional multi-arch support

Currently we still only build for x86_64, but now the test suite is
prepared for hooking up other architectures.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-12-10 01:52:39 +01:00 committed by Lars Karlitski
parent 9bedc0c393
commit 0d091decb5
16 changed files with 50 additions and 2 deletions

View file

@ -14,18 +14,47 @@ matrix:
env: GO111MODULE=on # needed even for Go 1.12
script: go test -v ./...
- name: image-test-empty-blueprint
arch: amd64
language: python
python: 3.7
before_install: sudo apt-get install -y qemu-kvm genisoimage
script:
# ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail...
- sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros'
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --cases test/cases/*_empty_blueprint.json
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --arches x86_64 --cases test/cases/*_empty_blueprint.json
- name: image-test-local-boot
arch: amd64
language: python
python: 3.7
before_install: sudo apt-get install -y qemu-kvm genisoimage
script:
# ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail...
- sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros'
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --cases test/cases/*_local_boot.json
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --arches x86_64 --cases test/cases/*_local_boot.json
- name: image-test
arch: arm64
language: python
python: 3.7
before_install: sudo apt-get install -y qemu-kvm genisoimage
script:
# ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail...
- sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros'
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --arches aarch64
- name: image-test
arch: ppc64le
language: python
python: 3.7
before_install: sudo apt-get install -y qemu-kvm genisoimage
script:
# ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail...
- sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros'
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --arches ppc64le
- name: image-test
arch: s390x
language: python
python: 3.7
before_install: sudo apt-get install -y qemu-kvm genisoimage
script:
# ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail...
- sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros'
- sudo env "PATH=$PATH" "PYTHONUNBUFFERED=1" "OSBUILD_TEST_BUILD_ENV=test/f27-build-from-ubuntu1804.json" test/run --arches s390x

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"filename": "image.raw.xz",
"output-format": "ami",
"blueprint": {}

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "partitioned-disk",
"filename": "disk.img",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "partitioned-disk",
"filename": "disk.img",
"blueprint-draft": {

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "ext4-filesystem",
"filename": "filesystem.img",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "ext4",
"filename": "filesystem.img",
"blueprint-draft": {

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "openstack",
"filename": "image.qcow2",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "openstack",
"filename": "image.qcow2",
"blueprint-draft": {

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "qcow2",
"filename": "image.qcow2",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "qcow2",
"filename": "image.qcow2",
"blueprint-draft": {

View file

@ -5,6 +5,7 @@
"compose": {
"output-format": "tar",
"distro": "fedora-30",
"arch": "x86_64",
"filename": "root.tar.xz",
"blueprint-draft": {
"name": "tar-boot-test",

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "vhd",
"filename": "image.vhd",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "vhd",
"filename": "image.vhd",
"blueprint-draft": {

View file

@ -1,6 +1,7 @@
{
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "vmdk",
"filename": "disk.vmdk",
"blueprint": {}

View file

@ -4,6 +4,7 @@
},
"compose": {
"distro": "fedora-30",
"arch": "x86_64",
"output-format": "vmdk",
"filename": "disk.vmdk",
"blueprint-draft": {

View file

@ -227,6 +227,7 @@ def run_test(case, private_key, store):
def main():
parser = argparse.ArgumentParser(description='Run test cases.')
parser.add_argument('--cases', type=str, nargs='*', help='Limit tests to given cases.')
parser.add_argument('--arches', type=str, nargs='*', help='Limit tests to given architectures.')
parser.add_argument('--distros', type=str, nargs='*', help='Limit tests to given distros.')
arg = parser.parse_args()
@ -242,6 +243,10 @@ def main():
if case["compose"]["distro"] not in arg.distros:
continue
if arg.arches:
if case["compose"]["arch"] not in arg.arches:
continue
print(f"RUNNING: {filename}")
if run_test(case, private_key, store):
print(f"SUCCESS")