From 7af8f9e3ab62c4c31d0f5143f8c40eb688bab58e Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 29 Sep 2023 18:10:41 -0700 Subject: [PATCH 1/2] tests: install: add comments and some logging Always fun reverse-engineering your own code months later. Signed-off-by: Marc Herbert --- tests/tests.bats | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/tests.bats b/tests/tests.bats index 2110dfb..0a2b49b 100644 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -96,7 +96,7 @@ test_install_one_version() # that's what we're testing here! cp "$TOP_DIR"/install.sh ./sof-bin-"$ver"/ - # Work from a copy to preserve the extracted tarball pristine, see below. + # Work from a $fromdir copy to preserve the extracted tarball pristine, see below. # Use some white space in dir names to catch quoting issues. local fromdir="./from sof-bin $ver"/ rsync -a ./sof-bin-"$ver"/ "$fromdir" @@ -110,18 +110,24 @@ test_install_one_version() } mkdir "$todir" "$todir"/tools + pwd + printf "'%s/install.sh' '%s' (todir='%s')\n" \ + "$fromdir" "$fromdir/$ver" "$todir" FW_DEST="$todir" TOOLS_DEST="$todir"/tools "$fromdir"/install.sh "$fromdir/$ver" - # Nothing must have changed in the extracted tarball $fromdir - diff -qr ./sof-bin-"$ver"/ "$fromdir" + # Before even looking at what we just installed, make sure no + # unexpected accident polluted our $fromdir copy + diff -qr "$fromdir" ./sof-bin-"$ver"/ local refdir="$fromdir" # to compare with the (potentially dirty) git checkout: # local refdir="$TOP_DIR/$vdir" + # At last check that install.sh copied firmware, topologies,... for suffix in '' -tplg; do diff -qr "$refdir/sof${suffix}-$ver"/ "$todir"/sof"$suffix"/ done + # ... and tools. diff -qr "$refdir/tools-$ver"/ "$todir"/tools/ popd || exit 1 From efde3e2fd2e1d374de2c9f8236b0c0e48bc0d17f Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 29 Sep 2023 17:25:24 -0700 Subject: [PATCH 2/2] tests: add new tarball_multi 2023.09 Signed-off-by: Marc Herbert --- tests/tests.bats | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/tests.bats b/tests/tests.bats index 0a2b49b..9c108d5 100644 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -164,7 +164,28 @@ test_install_one_version() popd || exit 1 } -# TODO: add a test_multi for v2.7 or above and a corresponding install.sh test +# First release with v2.7 +@test "tarball_multi 2023.09" { + local ver=2023.09 + test_init + + get_release v"$ver"/sof-bin-"$ver".tar.gz + + "$TOP_DIR"/tarball_multi_releases.bash -r $ver \ + v2.2.x/sof-v2.2 v2.2.x/tools-v2.2 \ + v2.2.x/sof-tplg-v2.2.1 v2.2.x/sof-tplg-v2.2.3 v2.2.x/sof-tplg-v2.2.4 \ + v2.2.x/sof-tplg-v2.2.5 v2.2.x/sof-tplg-v2.2.6 v2.2.x/sof-tplg-v2.2.7 \ + v2.7.x/sof-ace-tplg-v2.7 \ + v2.7.x/sof-ipc4-v2.7 \ + v2.7.x/tools-v2.7 + + tar xf sof-bin-"$ver".tar.gz + + diff -qr "$EXTR_REFS"/sof-bin-"$ver" "$(pwd)/sof-bin-$ver"/ + + popd || exit 1 +} + # You MUST call popd at the end test_init()