From 36178dddc45ee39e302516232c83b0fbc4c5dc37 Mon Sep 17 00:00:00 2001 From: dmarting Date: Mon, 28 Aug 2017 11:31:49 +0200 Subject: Automated rollback of commit 39448ebab889a6b5b1ceabcf932adfec9098dfe7. *** Reason for rollback *** Break docker builds *** Original change description *** Don't prepend ./ to filenames in pkg_tar rule Change-Id: Ib90ce99cc2e229bbe749130dbde517a075d6e333 PiperOrigin-RevId: 166679861 --- tools/build_defs/pkg/build_test.sh | 82 +++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 37 deletions(-) (limited to 'tools/build_defs/pkg/build_test.sh') diff --git a/tools/build_defs/pkg/build_test.sh b/tools/build_defs/pkg/build_test.sh index 4e80d85263..1322f5006d 100755 --- a/tools/build_defs/pkg/build_test.sh +++ b/tools/build_defs/pkg/build_test.sh @@ -97,34 +97,36 @@ function get_changes() { } function assert_content() { - local listing="etc/ -etc/nsswitch.conf -usr/ -usr/titi -usr/bin/ -usr/bin/java -> /path/to/bin/java" + local listing="./ +./etc/ +./etc/nsswitch.conf +./usr/ +./usr/titi +./usr/bin/ +./usr/bin/java -> /path/to/bin/java" check_eq "$listing" "$(get_tar_listing $1)" - check_eq "-rwxr-xr-x" "$(get_tar_permission $1 usr/titi)" - check_eq "-rw-r--r--" "$(get_tar_permission $1 etc/nsswitch.conf)" - check_eq "24/42" "$(get_numeric_tar_owner $1 etc/)" - check_eq "24/42" "$(get_numeric_tar_owner $1 etc/nsswitch.conf)" - check_eq "42/24" "$(get_numeric_tar_owner $1 usr/)" - check_eq "42/24" "$(get_numeric_tar_owner $1 usr/titi)" + check_eq "-rwxr-xr-x" "$(get_tar_permission $1 ./usr/titi)" + check_eq "-rw-r--r--" "$(get_tar_permission $1 ./etc/nsswitch.conf)" + check_eq "24/42" "$(get_numeric_tar_owner $1 ./etc/)" + check_eq "24/42" "$(get_numeric_tar_owner $1 ./etc/nsswitch.conf)" + check_eq "42/24" "$(get_numeric_tar_owner $1 ./usr/)" + check_eq "42/24" "$(get_numeric_tar_owner $1 ./usr/titi)" if [ -z "${2-}" ]; then - check_eq "tata/titi" "$(get_tar_owner $1 etc/)" - check_eq "tata/titi" "$(get_tar_owner $1 etc/nsswitch.conf)" - check_eq "titi/tata" "$(get_tar_owner $1 usr/)" - check_eq "titi/tata" "$(get_tar_owner $1 usr/titi)" + check_eq "tata/titi" "$(get_tar_owner $1 ./etc/)" + check_eq "tata/titi" "$(get_tar_owner $1 ./etc/nsswitch.conf)" + check_eq "titi/tata" "$(get_tar_owner $1 ./usr/)" + check_eq "titi/tata" "$(get_tar_owner $1 ./usr/titi)" fi } function test_tar() { - local listing="etc/ -etc/nsswitch.conf -usr/ -usr/titi -usr/bin/ -usr/bin/java -> /path/to/bin/java" + local listing="./ +./etc/ +./etc/nsswitch.conf +./usr/ +./usr/titi +./usr/bin/ +./usr/bin/java -> /path/to/bin/java" for i in "" ".gz" ".bz2" ".xz"; do assert_content "test-tar-${i:1}.tar$i" # Test merging tar files @@ -133,13 +135,18 @@ usr/bin/java -> /path/to/bin/java" assert_content "test-tar-inclusion-${i:1}.tar" "true" done; - check_eq "nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-empty.tar)" - check_eq "nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-none.tar)" - check_eq "nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-etc.tar)" - check_eq "etc/ -etc/nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-dot.tar)" - check_eq "not-etc/ -not-etc/mapped-filename.conf" "$(get_tar_listing test-tar-files_dict.tar)" + check_eq "./ +./nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-empty.tar)" + check_eq "./ +./nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-none.tar)" + check_eq "./ +./nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-etc.tar)" + check_eq "./ +./etc/ +./etc/nsswitch.conf" "$(get_tar_listing test-tar-strip_prefix-dot.tar)" + check_eq "./ +./not-etc/ +./not-etc/mapped-filename.conf" "$(get_tar_listing test-tar-files_dict.tar)" } function test_deb() { @@ -147,15 +154,16 @@ function test_deb() { echo "Unable to run test for debian, no dpkg-deb!" >&2 return 0 fi - local listing="etc/ -etc/nsswitch.conf -usr/ -usr/titi -usr/bin/ -usr/bin/java -> /path/to/bin/java" + local listing="./ +./etc/ +./etc/nsswitch.conf +./usr/ +./usr/titi +./usr/bin/ +./usr/bin/java -> /path/to/bin/java" check_eq "$listing" "$(get_deb_listing test-deb.deb)" - check_eq "-rwxr-xr-x" "$(get_deb_permission test-deb.deb usr/titi)" - check_eq "-rw-r--r--" "$(get_deb_permission test-deb.deb etc/nsswitch.conf)" + check_eq "-rwxr-xr-x" "$(get_deb_permission test-deb.deb ./usr/titi)" + check_eq "-rw-r--r--" "$(get_deb_permission test-deb.deb ./etc/nsswitch.conf)" get_deb_description test-deb.deb >$TEST_log expect_log "Description: toto" expect_log "Package: titi" -- cgit v1.2.3