diff --git a/.travis.yml b/.travis.yml index 303d4c4a6f..a8b0b6a8bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,15 @@ dist: trusty language: bash +env: + - AGENT_INIT=no + - AGENT_INIT=yes + services: - docker before_script: - ".ci/setup.sh" -script: +script: - "travis_wait .ci/run.sh" diff --git a/tests/image_creation.bats b/tests/image_creation.bats index 0261fd9931..3b60d8f7f7 100644 --- a/tests/image_creation.bats +++ b/tests/image_creation.bats @@ -7,6 +7,7 @@ rootfs_sh="$BATS_TEST_DIRNAME/../rootfs-builder/rootfs.sh" image_builder_sh="$BATS_TEST_DIRNAME/../image-builder/image_builder.sh" +initrd_builder_sh="$BATS_TEST_DIRNAME/../initrd-builder/initrd_builder.sh" readonly tmp_dir=$(mktemp -t -d osbuilder-test.XXXXXXX) #FIXME: Remove image size after https://github.com/kata-containers/osbuilder/issues/25 is fixed readonly image_size=400 @@ -23,27 +24,50 @@ teardown(){ rm -rf "${tmp_dir}" } -function build_image() +function build_rootfs() { distro="$1" [ -n "$distro" ] local rootfs="${tmp_dir}/rootfs-osbuilder" sudo -E ${rootfs_sh} -r "${rootfs}" "${distro}" - sudo ${image_builder_sh} -s ${image_size} -o "${tmp_dir}/image.img" "${rootfs}" +} + +function build_image() +{ + distro="$1" + [ -n "$distro" ] + local rootfs="${tmp_dir}/rootfs-osbuilder" + sudo -E ${image_builder_sh} -s ${image_size} -o "${tmp_dir}/image.img" "${rootfs}" +} + +function build_initrd() +{ + distro="$1" + [ -n "$distro" ] + local rootfs="${tmp_dir}/rootfs-osbuilder" + sudo -E ${initrd_builder_sh} -o "${tmp_dir}/initrd-image.img" "${rootfs}" } @test "Can create fedora image" { + build_rootfs fedora build_image fedora + build_initrd fedora } @test "Can create clearlinux image" { + build_rootfs clearlinux build_image clearlinux + build_initrd clearlinux } @test "Can create centos image" { - build_image centos + build_rootfs centos + build_image centos + build_initrd centos } @test "Can create euleros image" { + build_rootfs euleros build_image euleros + build_initrd euleros }