From c53afe25f1370bdb933870b9bd6b57ae179493c3 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 29 Apr 2024 19:58:26 +0000 Subject: [PATCH 01/12] initial commit [skip ci] --- bin/ch-test | 9 +++++++++ test/common.bash | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/bin/ch-test b/bin/ch-test index 2788eed42..0b54cd26c 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -669,6 +669,10 @@ test_one_file () { bats "$one_file" } +#build_one_image () { +# +#} + test_rootemu () { if command -v ch-image > /dev/null 2>&1; then bats force-auto.bats @@ -855,6 +859,11 @@ while [[ $# -gt 0 ]]; do -h|--help) usage 0 ;; + -i) + phase=one-file + one_file="${TMP_}/build_auto.bats:$1" + shift + ;; --img-dir) require_unset imgdir imgdir=$1; shift diff --git a/test/common.bash b/test/common.bash index c9f7a1d30..832fc1274 100644 --- a/test/common.bash +++ b/test/common.bash @@ -162,6 +162,28 @@ image_ok () { } +# Function to determine whether first argument is in the subsequent expanded +# array or sequence of words. + +# Example: +# $ is_elem "foo" "foo" "bar" "baz" +# 0 +# +# $ is_elem "banana" "foo" "bar" "baz" +# 1 +is_elem () { + local test_word="$1" + shift + local word_array=("$@") + for e in "${word_array[@]}" + do + if [[ "$e" == "$test_word" ]]; then + return 0 + fi + done + return 1 +} + localregistry_init () { # Skip unless GitHub Actions or there is a listener on localhost:5000. if [[ -z $GITHUB_ACTIONS ]] && ! ( command -v ss > /dev/null 2>&1 \ From 869d959a1cb3cecca808a3e726492c3bde3ac217 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 20 May 2024 17:17:27 +0000 Subject: [PATCH 02/12] pre-vacation progress --- bin/ch-test | 35 +++++++++++++++++++++++++++++------ test/common.bash | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index 0b54cd26c..fb383ad87 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -398,7 +398,7 @@ test_make () { local tag printf "finding tests compatible with %s phase settings ...\n" "$phase" case $phase in - build|build-images) + build|build-images|build-unpack) for i in $images $examples; do if test_make_check_image "$i"; then echo "found: $i" @@ -461,7 +461,7 @@ test_make () { } test_make_auto () { - local mode + local mode # mode is the test phase mode=$1;shift if [[ $mode != tag ]]; then printf "# Do not edit this file; it's autogenerated\n\n" @@ -495,7 +495,7 @@ test_make_auto () { fatal "test_make_auto: unknown build type" ;; esac - elif [[ $mode == run ]];then + elif [[ $mode == run || $mode == build-unpack ]];then test_make_template_print 'unpack.bats.in' else fatal "test_make_auto: invalid mode '$mode'" @@ -669,6 +669,10 @@ test_one_file () { bats "$one_file" } +test_build_unpack () { + bats "$one_file" +} + #build_one_image () { # #} @@ -860,8 +864,11 @@ while [[ $# -gt 0 ]]; do usage 0 ;; -i) - phase=one-file + #phase=one-file + phase=build-unpack one_file="${TMP_}/build_auto.bats:$1" + build_targets+=("$1") + #CHTEST_BUILD_UNPACK+=" $1" shift ;; --img-dir) @@ -954,6 +961,9 @@ while [[ $# -gt 0 ]]; do esac done +# build-unpack images can only be passed to common.bash as a string. +export CHTEST_BUILD_UNPACK="${build_targets[@]}" + printf 'ch-run: %s (%s)\n' "${ch_bin}/ch-run" "$ch_libc" printf 'bats: %s (%s)\n' "$bats" "$bats_version" if [[ $(printf "%s\n%s" "$bats_version" "$bats_vmin" | sort -V | head -1) \ @@ -971,23 +981,29 @@ else fi printf 'contributor: %s\n\n' "$ch_contributor_note" -if [[ $phase = one-file ]]; then +if [[ $phase = one-file || $phase = build-unpack ]]; then + printf "FOO\n" if [[ $one_file == *:* ]]; then + printf "FOO2\n" x=$one_file one_file=${x%%:*} # before first colon export ch_one_test=${x#*:} # after first colon fi + printf "FOO3\n" + # ERROR HERE!! if [[ ! -f $one_file ]]; then fatal "not a file: $one_file" fi + printf "BAR\n" one_file=$(readlink -f "$one_file") # make absolute b/c we cd later + printf "BAZ\n" if [[ $one_file = */test.bats ]]; then fatal '--file: must specify build recipe file, not test.bats' fi fi printf "%-21s %s" 'phase:' "$phase" -if [[ $phase = one-file ]]; then +if [[ $phase = one-file || $phase = build-unpack ]]; then printf ': %s (%s)' "$one_file" "$ch_one_test" fi if [[ -z $phase ]]; then @@ -1196,6 +1212,13 @@ case $phase in test_build_images win ;; + build-unpack) + builder_check + dir_tar_mk + test_make + test_build_unpack + win + ;; mk-perm-dirs) printf 'creating filesystem permissions fixtures ...\n' for d in $CH_TEST_PERMDIRS; do diff --git a/test/common.bash b/test/common.bash index 832fc1274..17d592744 100644 --- a/test/common.bash +++ b/test/common.bash @@ -174,13 +174,16 @@ image_ok () { is_elem () { local test_word="$1" shift - local word_array=("$@") - for e in "${word_array[@]}" + IFS_tmp=$IFS + IFS=' ' + for word in "$@" do - if [[ "$e" == "$test_word" ]]; then + if [[ "$test_word" == "$word" ]]; then + IFS=$IFS_tmp return 0 fi done + IFS=$IFS_tmp return 1 } @@ -273,6 +276,32 @@ scope () { else return 0 fi + # If “CHTEST_BUILD_UNPACK” has been set, then one or more images have been + # specified for building and unpacking. Assume “CHTEST_BUILD_UNPACK is a + # string-separated sequence of complete image names, e.g. + + # CHTEST_BUILD_UNPACK="argenv copy hello" + + # If this variable is set, we should skip all tests EXCEPT when + # “BATS_TEST_DESCRIPTION” takes the form of: + + # - “build X” + # - “builder to archive X” + # - “unpack X” + + # Where “X” is an entry in “CHTEST_BUILD_UNPACK” + + # So we need something like: + + # for img in $CHTEST_BUILD_UNPACK; do + # if [[ BATS_TEST_DESCRIPTION == "build $img" \ + # || BATS_TEST_DESCRIPTION == "builder to archive $img" \ + # || BATS_TEST_DESCRIPTION == "unpack $img" ]]; then + # return 0 + # else + # skip 'reason...' + # fi + # done fi case $1 in # $1 is the test’s scope quick) From b6fab91de958471915014b33a7039bd8a5b3fe28 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 17 Jun 2024 20:05:59 +0000 Subject: [PATCH 03/12] multiple images working --- bin/ch-test | 46 +++++++++++++++++++++++++++++++++++++++++++--- test/common.bash | 8 ++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index 0b54cd26c..c9fda7f1a 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -410,7 +410,15 @@ test_make () { test_make_auto "$phase" "${build_targets[@]}" > "${TMP_}/build_auto.bats" printf 'ok\n\n' ;; - run) + #build-targeted) + # for i in $ch_build_unpack_list; do + # if test_make_check_image "$i"; then + # echo "found: $i" + # build_targets+=( "$i" ) + # fi + # done + # ;; + run) # For each tarball or squashfs file in --pack-dir look for a # corresponding example or image that produces a matching tag. If # found, check the image for exclusion conidtions. @@ -669,6 +677,17 @@ test_one_file () { bats "$one_file" } +test_build_unpack () { + case $phase in + build) + bats "${TMP_}/build_auto.bats" + ;; + run) + bats "${TMP_}/run_auto.bats" + ;; + esac +} + #build_one_image () { # #} @@ -820,6 +839,7 @@ fi if [[ $# == 0 ]]; then usage 1 fi +ch_build_unpack_list="" while [[ $# -gt 0 ]]; do opt=$1; shift case $opt in @@ -860,8 +880,12 @@ while [[ $# -gt 0 ]]; do usage 0 ;; -i) - phase=one-file - one_file="${TMP_}/build_auto.bats:$1" + #phase=one-file + phase=build-unpack + #one_file="${TMP_}/build_auto.bats:$1" + # FIXME: remove ch_build_unpack + export ch_build_unpack="true" + ch_build_unpack_list+=" $1" shift ;; --img-dir) @@ -954,6 +978,8 @@ while [[ $# -gt 0 ]]; do esac done +export ch_build_unpack_list + printf 'ch-run: %s (%s)\n' "${ch_bin}/ch-run" "$ch_libc" printf 'bats: %s (%s)\n' "$bats" "$bats_version" if [[ $(printf "%s\n%s" "$bats_version" "$bats_vmin" | sort -V | head -1) \ @@ -1177,6 +1203,20 @@ case $phase in test_build win ;; + build-unpack) + phase=build + dir_tar_mk + builder_check + test_make + test_build_images + test_build + + #phase=run + dir_img_mk + dir_tar_check + test_make + test_run + ;; clean) dirs_unpriv_rm if [[ -d $TMP_ ]] && [[ -e $TMP_/build_auto.bats ]]; then diff --git a/test/common.bash b/test/common.bash index 832fc1274..22404ad27 100644 --- a/test/common.bash +++ b/test/common.bash @@ -274,6 +274,14 @@ scope () { return 0 fi fi + if [[ -n $ch_build_unpack_list ]]; then + for image in $ch_build_unpack_list; do + if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* ]]; then + return 0 + fi + done + skip 'per -i' + fi case $1 in # $1 is the test’s scope quick) ;; # always run quick-scope tests From ec10512d1423e83a35455be0a614551dd684b6e0 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Tue, 18 Jun 2024 17:03:18 +0000 Subject: [PATCH 04/12] rough working version --- bin/ch-test | 20 +++++--------------- test/common.bash | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index c9fda7f1a..16fe102ed 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -410,14 +410,6 @@ test_make () { test_make_auto "$phase" "${build_targets[@]}" > "${TMP_}/build_auto.bats" printf 'ok\n\n' ;; - #build-targeted) - # for i in $ch_build_unpack_list; do - # if test_make_check_image "$i"; then - # echo "found: $i" - # build_targets+=( "$i" ) - # fi - # done - # ;; run) # For each tarball or squashfs file in --pack-dir look for a # corresponding example or image that produces a matching tag. If @@ -688,10 +680,6 @@ test_build_unpack () { esac } -#build_one_image () { -# -#} - test_rootemu () { if command -v ch-image > /dev/null 2>&1; then bats force-auto.bats @@ -1209,13 +1197,15 @@ case $phase in builder_check test_make test_build_images - test_build + #test_build + #test_build_unpack - #phase=run + phase=run dir_img_mk dir_tar_check test_make - test_run + #test_run + test_build_unpack ;; clean) dirs_unpriv_rm diff --git a/test/common.bash b/test/common.bash index 22404ad27..84c4324e8 100644 --- a/test/common.bash +++ b/test/common.bash @@ -276,7 +276,7 @@ scope () { fi if [[ -n $ch_build_unpack_list ]]; then for image in $ch_build_unpack_list; do - if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* ]]; then + if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* || $BATS_TEST_DESCRIPTION == *"custom build chtest"* ]]; then return 0 fi done From 91dd4fdfc97c61851a7a3d5075a30287ffb700b3 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Tue, 18 Jun 2024 17:52:47 +0000 Subject: [PATCH 05/12] small change to build-unpack [skip ci] --- bin/ch-test | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index 16fe102ed..0e15725b6 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -1196,15 +1196,12 @@ case $phase in dir_tar_mk builder_check test_make - test_build_images - #test_build - #test_build_unpack + test_build_unpack phase=run dir_img_mk dir_tar_check test_make - #test_run test_build_unpack ;; clean) From 24fb9c50a93274b85f95291777938849744ab031 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Tue, 18 Jun 2024 20:00:40 +0000 Subject: [PATCH 06/12] fix some merge jank [skip ci] --- bin/ch-test | 5 +---- test/common.bash | 35 +++-------------------------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index e37612257..fa768dd1a 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -985,16 +985,13 @@ else fi printf 'contributor: %s\n\n' "$ch_contributor_note" -if [[ $phase = one-file || $phase = build-unpack ]]; then +if [[ $phase = one-file ]]; then printf "FOO\n" if [[ $one_file == *:* ]]; then - printf "FOO2\n" x=$one_file one_file=${x%%:*} # before first colon export ch_one_test=${x#*:} # after first colon fi - printf "FOO3\n" - # ERROR HERE!! if [[ ! -f $one_file ]]; then fatal "not a file: $one_file" fi diff --git a/test/common.bash b/test/common.bash index 9b21fb765..84c4324e8 100644 --- a/test/common.bash +++ b/test/common.bash @@ -174,16 +174,13 @@ image_ok () { is_elem () { local test_word="$1" shift - IFS_tmp=$IFS - IFS=' ' - for word in "$@" + local word_array=("$@") + for e in "${word_array[@]}" do - if [[ "$test_word" == "$word" ]]; then - IFS=$IFS_tmp + if [[ "$e" == "$test_word" ]]; then return 0 fi done - IFS=$IFS_tmp return 1 } @@ -276,32 +273,6 @@ scope () { else return 0 fi - # If “CHTEST_BUILD_UNPACK” has been set, then one or more images have been - # specified for building and unpacking. Assume “CHTEST_BUILD_UNPACK is a - # string-separated sequence of complete image names, e.g. - - # CHTEST_BUILD_UNPACK="argenv copy hello" - - # If this variable is set, we should skip all tests EXCEPT when - # “BATS_TEST_DESCRIPTION” takes the form of: - - # - “build X” - # - “builder to archive X” - # - “unpack X” - - # Where “X” is an entry in “CHTEST_BUILD_UNPACK” - - # So we need something like: - - # for img in $CHTEST_BUILD_UNPACK; do - # if [[ BATS_TEST_DESCRIPTION == "build $img" \ - # || BATS_TEST_DESCRIPTION == "builder to archive $img" \ - # || BATS_TEST_DESCRIPTION == "unpack $img" ]]; then - # return 0 - # else - # skip 'reason...' - # fi - # done fi if [[ -n $ch_build_unpack_list ]]; then for image in $ch_build_unpack_list; do From 34099db8dd2d143e464dbe9e2e8ef53ee8b4c8dc Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Thu, 20 Jun 2024 16:27:33 +0000 Subject: [PATCH 07/12] remove some debug lines --- bin/ch-test | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index fa768dd1a..b72bd9919 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -986,7 +986,6 @@ fi printf 'contributor: %s\n\n' "$ch_contributor_note" if [[ $phase = one-file ]]; then - printf "FOO\n" if [[ $one_file == *:* ]]; then x=$one_file one_file=${x%%:*} # before first colon @@ -995,9 +994,7 @@ if [[ $phase = one-file ]]; then if [[ ! -f $one_file ]]; then fatal "not a file: $one_file" fi - printf "BAR\n" one_file=$(readlink -f "$one_file") # make absolute b/c we cd later - printf "BAZ\n" if [[ $one_file = */test.bats ]]; then fatal '--file: must specify build recipe file, not test.bats' fi From 3d65706ecf9b189359b108a88a7baa100eb922bc Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Thu, 25 Jul 2024 22:06:56 +0000 Subject: [PATCH 08/12] small changes + docs --- bin/ch-test | 18 +++++++++--------- doc/ch-test.rst | 9 +++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index b72bd9919..2e0afe034 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -88,6 +88,8 @@ EOF bats_vmin=1.2.0 # FIXME: get from configure somehow? +ch_build_unpack_all="argenv quick copy almalinux_8ch debian_11ch hello multistage seccomp" + ### Functions @@ -410,7 +412,7 @@ test_make () { test_make_auto "$phase" "${build_targets[@]}" > "${TMP_}/build_auto.bats" printf 'ok\n\n' ;; - run) + run) # For each tarball or squashfs file in --pack-dir look for a # corresponding example or image that produces a matching tag. If # found, check the image for exclusion conidtions. @@ -831,7 +833,7 @@ ch_build_unpack_list="" while [[ $# -gt 0 ]]; do opt=$1; shift case $opt in - all|build|build-images|clean|examples|mk-perm-dirs|rm-perm-dirs|rootemu|run) + all|build|build-images|build-unpack|clean|examples|mk-perm-dirs|rm-perm-dirs|rootemu|run) require_unset phase phase=$opt ;; @@ -1192,6 +1194,11 @@ case $phase in win ;; build-unpack) + if [[ -z "$ch_build_unpack_list" ]]; then + # Assume “build-unpack” was specified without “-i” being called, + # build and upack all images. + ch_build_unpack_list="$ch_build_unpack_all" + fi phase=build dir_tar_mk builder_check @@ -1223,13 +1230,6 @@ case $phase in test_build_images win ;; - build-unpack) - builder_check - dir_tar_mk - test_make - test_build_unpack - win - ;; mk-perm-dirs) printf 'creating filesystem permissions fixtures ...\n' for d in $CH_TEST_PERMDIRS; do diff --git a/doc/ch-test.rst b/doc/ch-test.rst index 405e7f541..951864493 100644 --- a/doc/ch-test.rst +++ b/doc/ch-test.rst @@ -93,6 +93,11 @@ allows trading off thoroughness versus time. :code:`build-images` Build images from :code:`build` phase, without running the associated tests. + :code:`build-unpack` + Build and unpack images only. By default, build and unpack all applicable + images. If one or more images have been specified with :code:`-i`, build and + unpack those images only. + :code:`clean` Delete automatically-generated test files, and packed and unpacked image directories. @@ -159,6 +164,10 @@ Additional arguments: :code:`-h`, :code:`--help` Print usage and then exit. + :code:`-i IMG` + Build and unpack specified image (:code:`IMG`), can be repeated to build and + unpack multiple images. Implies :code:`build-unpack` as the phase. + :code:`--img-dir DIR` Set unpacked images directory to :code:`DIR`. In a multi-node allocation, this directory may not be shared between nodes. Default: From ea823c040d773e7caaf580ce5404b43dcd706d68 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 29 Jul 2024 19:11:49 +0000 Subject: [PATCH 09/12] skip chtest --- bin/ch-test | 3 +++ test/common.bash | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/ch-test b/bin/ch-test index 2e0afe034..a82498923 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -199,6 +199,9 @@ dir_tar_check_file () { for f in "$@"; do if [[ -f ${CH_TEST_TARDIR}/${f} ]]; then return 0 + elif [[ "$f" == *"chtest"* ]] && [[ -n "$ch_build_unpack_list" ]]; then + # chtest not needed for build-unpack phase + return 0 else missing+=("${CH_TEST_TARDIR}/${f}") fi diff --git a/test/common.bash b/test/common.bash index 84c4324e8..22404ad27 100644 --- a/test/common.bash +++ b/test/common.bash @@ -276,7 +276,7 @@ scope () { fi if [[ -n $ch_build_unpack_list ]]; then for image in $ch_build_unpack_list; do - if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* || $BATS_TEST_DESCRIPTION == *"custom build chtest"* ]]; then + if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* ]]; then return 0 fi done From 3853630e6443f1316e76c617f191850b0f6a81b8 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 29 Jul 2024 20:35:04 +0000 Subject: [PATCH 10/12] remove unused function, shorten too-long line --- test/common.bash | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/test/common.bash b/test/common.bash index 22404ad27..23f6a635a 100644 --- a/test/common.bash +++ b/test/common.bash @@ -162,28 +162,6 @@ image_ok () { } -# Function to determine whether first argument is in the subsequent expanded -# array or sequence of words. - -# Example: -# $ is_elem "foo" "foo" "bar" "baz" -# 0 -# -# $ is_elem "banana" "foo" "bar" "baz" -# 1 -is_elem () { - local test_word="$1" - shift - local word_array=("$@") - for e in "${word_array[@]}" - do - if [[ "$e" == "$test_word" ]]; then - return 0 - fi - done - return 1 -} - localregistry_init () { # Skip unless GitHub Actions or there is a listener on localhost:5000. if [[ -z $GITHUB_ACTIONS ]] && ! ( command -v ss > /dev/null 2>&1 \ @@ -276,7 +254,9 @@ scope () { fi if [[ -n $ch_build_unpack_list ]]; then for image in $ch_build_unpack_list; do - if [[ $BATS_TEST_DESCRIPTION == *"build $image"* || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* || $BATS_TEST_DESCRIPTION == *"unpack $image"* ]]; then + if [[ $BATS_TEST_DESCRIPTION == *"build $image"* \ + || $BATS_TEST_DESCRIPTION == *"builder to archive $image"* \ + || $BATS_TEST_DESCRIPTION == *"unpack $image"* ]]; then return 0 fi done From 661757099c13de0bb96e2e93d8c78dbd7260d0d9 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 29 Jul 2024 21:04:31 +0000 Subject: [PATCH 11/12] small cleanup [skip ci] --- bin/ch-test | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/ch-test b/bin/ch-test index a82498923..db7c281fc 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -873,11 +873,7 @@ while [[ $# -gt 0 ]]; do usage 0 ;; -i) - #phase=one-file phase=build-unpack - #one_file="${TMP_}/build_auto.bats:$1" - # FIXME: remove ch_build_unpack - export ch_build_unpack="true" ch_build_unpack_list+=" $1" shift ;; From 17ae0bb45e7c024554322a123dba0fdadd695ba4 Mon Sep 17 00:00:00 2001 From: Reid Priedhorsky Date: Mon, 26 Aug 2024 15:08:59 -0600 Subject: [PATCH 12/12] tinker with docs [skip ci] --- doc/ch-test.rst | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/ch-test.rst b/doc/ch-test.rst index 951864493..4bbdff11a 100644 --- a/doc/ch-test.rst +++ b/doc/ch-test.rst @@ -90,13 +90,10 @@ allows trading off thoroughness versus time. Create the filesystem permissions directories. Requires :code:`--perm-dirs`. - :code:`build-images` - Build images from :code:`build` phase, without running the associated tests. - :code:`build-unpack` - Build and unpack images only. By default, build and unpack all applicable - images. If one or more images have been specified with :code:`-i`, build and - unpack those images only. + Build and unpack images only, without running the associated tests. By + default, build/unpack all images from the *build* phase. If :code:`-i` is + given, build/unpack those images only. :code:`clean` Delete automatically-generated test files, and packed and unpacked image @@ -112,8 +109,8 @@ allows trading off thoroughness versus time. where you must specify the corresponding Dockerfile or :code:`Build` file instead. This is somewhat brittle and typically used for development or debugging. For example, it does not check whether the pre-requisites of - whatever is in the file are satisfied. Often running :code:`build` and - :code:`run` first is sufficient, but this varies. + whatever is in the file are satisfied. Often running :code:`build-unpack` + and first is sufficient, but this varies. If :code:`TEST` is also given, then run only tests with name containing that string, skipping the others. The separator is a literal colon. If the @@ -165,8 +162,8 @@ Additional arguments: Print usage and then exit. :code:`-i IMG` - Build and unpack specified image (:code:`IMG`), can be repeated to build and - unpack multiple images. Implies :code:`build-unpack` as the phase. + Build and unpack specified image (:code:`IMG`); can be repeated for + multiple images. Implies :code:`build-unpack` as the phase. :code:`--img-dir DIR` Set unpacked images directory to :code:`DIR`. In a multi-node allocation,