From 86aeadb4c3d56f168e0bce34e0e2fa06c1ccb78b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 12 Jun 2013 19:30:34 -0600 Subject: test/: use libremakepkg instead of arch-*build --- test/test.d/db-update.sh | 4 ++-- test/test.d/testing2x.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 7a5ce4c..4b3008e 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -82,7 +82,7 @@ testUpdateAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null - sudo extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null @@ -100,7 +100,7 @@ testUpdateAnyPackageToDifferentRepositoriesAtOnce() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null - sudo extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index 31d85b4..0c2fa83 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -10,7 +10,7 @@ testTesting2xAnyPackage() { pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD arch_svn commit -q -m"update pkg to pkgrel=2" >/dev/null - sudo extra-i686-build + sudo libremakepkg mv pkg-any-a-1-2-any.pkg.tar.xz "${pkgdir}/pkg-any-a/" popd >/dev/null -- cgit v1.2.3-2-g168b From 5ba4756a52e8f1280d4dbcff62dec4a4aeb47d1c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 12 Jun 2013 19:32:48 -0600 Subject: Don't make assumptions about the host architecture. --- test/test.d/create-filelists.sh | 8 ++++---- test/test.d/db-move.sh | 8 ++++---- test/test.d/db-remove.sh | 4 ++-- test/test.d/db-repo-add.sh | 4 ++-- test/test.d/db-repo-remove.sh | 4 ++-- test/test.d/db-update.sh | 8 ++++---- test/test.d/ftpdir-cleanup.sh | 6 +++--- test/test.d/sourceballs.sh | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 49734c4..8df7030 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testCreateSimpleFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -26,7 +26,7 @@ testCreateSimpleFileLists() { } testCreateAnyFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase local arch @@ -46,7 +46,7 @@ testCreateAnyFileLists() { } testCreateSplitFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -75,7 +75,7 @@ testCreateSplitFileLists() { testCleanupFileLists() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 890ffc4..3cf355b 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testMoveSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -28,7 +28,7 @@ testMoveSimplePackages() { } testMoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -52,7 +52,7 @@ testMoveMultiplePackages() { } testMoveEpochPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-epoch') local pkgbase local arch @@ -90,7 +90,7 @@ testMoveAnyPackages() { } testMoveSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index 416e693..d79605e 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch @@ -31,7 +31,7 @@ testRemovePackages() { } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/db-repo-add.sh b/test/test.d/db-repo-add.sh index 8603104..09fc52f 100755 --- a/test/test.d/db-repo-add.sh +++ b/test/test.d/db-repo-add.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -27,7 +27,7 @@ testAddSimplePackages() { } testAddMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch diff --git a/test/test.d/db-repo-remove.sh b/test/test.d/db-repo-remove.sh index 315d63d..eec0109 100755 --- a/test/test.d/db-repo-remove.sh +++ b/test/test.d/db-repo-remove.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testRemovePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -31,7 +31,7 @@ testRemovePackages() { } testRemoveMultiplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 4b3008e..4e77140 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testAddSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -52,7 +52,7 @@ testAddAnyPackages() { } testAddSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -132,7 +132,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { ../db-update >/dev/null 2>&1 && (fail 'Adding an existing package to another repository should fail'; return 1) local arch - for arch in i686 x86_64; do + for arch in $(arches); do ( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" @@ -141,7 +141,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { testAddIncompleteSplitPackage() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local repo='extra' local pkgbase='pkg-split-a' local arch diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index bfea7ea..630b88f 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testCleanupSimplePackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch @@ -35,7 +35,7 @@ testCleanupSimplePackages() { } testCleanupEpochPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-epoch') local pkgbase local arch @@ -85,7 +85,7 @@ testCleanupAnyPackages() { } testCleanupSplitPackages() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index fdcf08c..472cb30 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -4,7 +4,7 @@ curdir=$(readlink -e $(dirname $0)) . "${curdir}/../lib/common.inc" testSourceballs() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch @@ -38,7 +38,7 @@ testAnySourceballs() { } testSplitSourceballs() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-split-a' 'pkg-split-b') local pkg local pkgbase @@ -59,7 +59,7 @@ testSplitSourceballs() { } testSourceballsCleanup() { - local arches=('i686' 'x86_64') + local arches=(`arches`) local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase local arch -- cgit v1.2.3-2-g168b From d0e9909ce3419c36e134227318a29f2f1fd782a2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 15 Jun 2013 13:57:35 -0600 Subject: fix tests - properly set SRCPOOL - have SVNREPO point to the checkout, not the server repo - in case TMPDIR has a symlink in it, use `readlink -e` on both sides of inspecting symlinks. - use `grep {pattern} &>/dev/null` instead of `grep -q {pattern}`. Because `grep -q` is able to bail early, a program being piped in to it may spit out a message about a write error to stderr. --- test/test.d/create-filelists.sh | 10 +++++----- test/test.d/db-update.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 8df7030..e78bde8 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -18,7 +18,7 @@ testCreateSimpleFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgbase}" &>/dev/null; then fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" fi done @@ -38,7 +38,7 @@ testCreateAnyFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/share/${pkgbase}/test" &>/dev/null; then fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" fi done @@ -65,7 +65,7 @@ testCreateSplitFileLists() { pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) for pkgname in ${pkgnames[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" fi done @@ -92,10 +92,10 @@ testCleanupFileLists() { done for arch in ${arches[@]}; do - if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then + if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-b" &>/dev/null; then fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}" fi - if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then + if bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/pkg-simple-a" &>/dev/null; then fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" fi done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 4e77140..7f1874b 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -134,7 +134,7 @@ testUpdateSameAnyPackageToDifferentRepositories() { local arch for arch in $(arches); do ( [ -r "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ + && bsdtar -xf "${FTP_BASE}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep ${pkgbase} &>/dev/null) \ && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" done } @@ -157,7 +157,7 @@ testAddIncompleteSplitPackage() { for arch in ${arches[@]}; do ( [ -r "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ + && bsdtar -xf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep ${pkgbase} &>/dev/null) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" done } -- cgit v1.2.3-2-g168b From c54e53593927e5469cfe13bacd29d25168235606 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 17 Jun 2014 23:23:31 -0400 Subject: more quoting fixes --- test/test.d/create-filelists.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index e78bde8..1126972 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -1,6 +1,6 @@ #!/bin/bash -curdir=$(readlink -e $(dirname $0)) +curdir="$(readlink -e "$(dirname "$0")")" . "${curdir}/../lib/common.inc" testCreateSimpleFileLists() { @@ -9,15 +9,15 @@ testCreateSimpleFileLists() { local pkgbase local arch - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do - releasePackage extra ${pkgbase} ${arch} + for pkgbase in "${pkgs[@]}"; do + for arch in "${arches[@]}"; do + releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do + for pkgbase in "${pkgs[@]}"; do + for arch in "${arches[@]}"; do if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgbase}" &>/dev/null; then fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" fi @@ -31,13 +31,13 @@ testCreateAnyFileLists() { local pkgbase local arch - for pkgbase in ${pkgs[@]}; do - releasePackage extra ${pkgbase} any + for pkgbase in "${pkgs[@]}"; do + releasePackage extra "${pkgbase}" any done ../db-update - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do + for pkgbase in "${pkgs[@]}"; do + for arch in "${arches[@]}"; do if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/share/${pkgbase}/test" &>/dev/null; then fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" fi @@ -54,17 +54,17 @@ testCreateSplitFileLists() { local pkgnames local arch - for pkgbase in ${pkgs[@]}; do - for arch in ${arches[@]}; do - releasePackage extra ${pkgbase} ${arch} + for pkgbase in "${pkgs[@]}"; do + for arch in "${arches[@]}"; do + releasePackage extra "${pkgbase}" "${arch}" done done ../db-update - for pkgbase in ${pkgs[@]}; do - pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) - for pkgname in ${pkgnames[@]}; do - for arch in ${arches[@]}; do + for pkgbase in "${pkgs[@]}"; do + eval "pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + for pkgname in "${pkgnames[@]}"; do + for arch in "${arches[@]}"; do if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" fi -- cgit v1.2.3-2-g168b From e8f411803648f64b386dd2970b024b9ba15ba682 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 11:12:18 -0400 Subject: The eval+printf %q thing wasn't worth the hard-to-read code --- test/test.d/create-filelists.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test.d') diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 1126972..b5ec5c8 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -62,7 +62,7 @@ testCreateSplitFileLists() { ../db-update for pkgbase in "${pkgs[@]}"; do - eval "pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo "${pkgname[@]}")) for pkgname in "${pkgnames[@]}"; do for arch in "${arches[@]}"; do if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then -- cgit v1.2.3-2-g168b