From 71e4fa60cd00c42c6af3c45e8149d8c0cd29f6e0 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Sun, 14 Nov 2021 12:28:52 +0000 Subject: Build all versions based on shortname, fix shebang, tag catalina latest --- tests/test.sh | 136 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 60 insertions(+), 76 deletions(-) (limited to 'tests/test.sh') diff --git a/tests/test.sh b/tests/test.sh index e66f04f..b26931a 100644 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/docker +#!/usr/bin/bash # ____ __ ____ ______ __ # / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ / # / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| / @@ -120,13 +120,17 @@ NO_CACHE="${NO_CACHE:=--no-cache}" TEST_BUILDS=( -'docker-osx:latest' -'docker-osx:naked' -'docker-osx:naked-auto' -'docker-osx:big-sur' -'docker-osx:monterey' -'docker-osx:auto' -#'docker-osx:auto-big-sur' + 'docker-osx:naked' + 'docker-osx:naked-auto' + 'docker-osx:auto' +) + +VERSION_BUILDS=( + 'high-sierra' + 'mojave' + 'catalina' + 'big-sur' + 'monterey' ) install_docker () { @@ -196,23 +200,10 @@ enable_kvm () { echo 1 | tee /sys/module/kvm/parameters/ignore_msrs } - clone_repo () { git clone --branch="${1}" "${2}" Docker-OSX } - -docker-osx:latest () { - docker build ${NO_CACHE} \ - --build-arg BRANCH="${BRANCH}" \ - --build-arg RANKMIRRORS=true \ - --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ - -f ./Dockerfile \ - -t docker-osx:latest . - docker tag docker-osx:latest sickcodes/docker-osx:latest -} - - docker-osx:naked () { docker build ${NO_CACHE} \ --squash \ @@ -223,7 +214,6 @@ docker-osx:naked () { docker tag docker-osx:naked sickcodes/docker-osx:naked } - docker-osx:naked-auto () { docker build ${NO_CACHE} \ --squash \ @@ -234,26 +224,6 @@ docker-osx:naked-auto () { docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto } - -docker-osx:big-sur () { - docker build ${NO_CACHE} \ - --build-arg VERSION=11 \ - --build-arg RANKMIRRORS=true \ - --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ - -f ./Dockerfile \ - -t docker-osx:big-sur . - docker tag docker-osx:big-sur sickcodes/docker-osx:big-sur -} - -docker-osx:monterey () { - docker build ${NO_CACHE} \ - --build-arg RANKMIRRORS=true \ - --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ - -f ./Dockerfile.monterey \ - -t docker-osx:monterey . - docker tag docker-osx:monterey sickcodes/docker-osx:monterey -} - docker-osx:auto () { docker build ${NO_CACHE} \ --build-arg RANKMIRRORS=true \ @@ -263,14 +233,26 @@ docker-osx:auto () { docker tag docker-osx:auto sickcodes/docker-osx:auto } -docker-osx:auto-big-sur () { +# docker-osx:auto-big-sur () { +# docker build ${NO_CACHE} \ +# --build-arg RANKMIRRORS=true \ +# --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ +# --build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \ +# -f ./Dockerfile.auto \ +# -t docker-osx:auto-big-sur . +# docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur +# } + +docker-osx:version () { + SHORTNAME="${1}" docker build ${NO_CACHE} \ + --build-arg BRANCH="${BRANCH}" \ --build-arg RANKMIRRORS=true \ + --build-arg SHORTNAME="${SHORTNAME}" \ --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ - --build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \ - -f ./Dockerfile.auto \ - -t docker-osx:auto-big-sur . - docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur + -f ./Dockerfile \ + -t "docker-osx:${SHORTNAME}" . + docker tag "docker-osx:${SHORTNAME}" "sickcodes/docker-osx:${SHORTNAME}" } reset_docker_hard () { @@ -288,42 +270,44 @@ EOF systemctl enable --now docker } -tee -a ~/.bashrc < Date: Sun, 14 Nov 2021 18:16:53 +0000 Subject: Add static expected screenshots of installation images to ./tests/ --- tests/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test.sh') diff --git a/tests/test.sh b/tests/test.sh index b26931a..2ba1ed0 100644 --- a/tests/test.sh +++ b/tests/test.sh @@ -178,7 +178,7 @@ install_scrotcat () { make -C ./imcat sudo cp ./imcat/imcat /usr/bin/imcat touch /usr/bin/scrotcat - tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' + tee /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' chmod +x /usr/bin/scrotcat } @@ -285,8 +285,8 @@ yes | apt install -y --no-install-recommends tzdata -y install_scrotcat yes | install_vnc export_display_99 -echo start_xvfb -start_vnc +start_xvfb +# start_vnc enable_kvm reset_docker_hard echo killall Xvfb -- cgit v1.2.3 From 9ca9372da1b8c12eda08a7a47d0bc4f1c7ddb805 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Sun, 14 Nov 2021 18:35:09 +0000 Subject: Add diff of screenshots to test suite, works good --- tests/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/test.sh') diff --git a/tests/test.sh b/tests/test.sh index 2ba1ed0..84ec774 100644 --- a/tests/test.sh +++ b/tests/test.sh @@ -12,7 +12,7 @@ # Repository: https://github.com/sickcodes/Docker-OSX # Website: https://sick.codes # -# Status: Work in progress. +# Status: Used internally to auto build, run and test images on DO. # help_text="Usage: ./test.sh --branch --repo @@ -303,6 +303,9 @@ for TEST_BUILD in "${TEST_BUILDS[@]}"; do "${TEST_BUILD}" done +# boot each image and test +bash ./tests/boot-images.sh || exit 1 + if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \ && for SHORTNAME in "${VERSION_BUILDS[@]}"; do -- cgit v1.2.3