diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/common.inc | 98 | ||||
-rwxr-xr-x | test/lib/shunit2 | 10 | ||||
-rwxr-xr-x | test/test.d/create-filelists.sh | 22 | ||||
-rwxr-xr-x | test/test.d/db-move.sh | 4 | ||||
-rwxr-xr-x | test/test.d/db-update.sh | 20 | ||||
-rwxr-xr-x | test/test.d/ftpdir-cleanup.sh | 4 | ||||
-rwxr-xr-x | test/test.d/packages.sh | 2 | ||||
-rwxr-xr-x | test/test.d/pool-transition.sh | 20 | ||||
-rwxr-xr-x | test/test.d/signed-packages.sh | 2 | ||||
-rwxr-xr-x | test/test.d/sourceballs.sh | 10 | ||||
-rwxr-xr-x | test/test.d/testing2x.sh | 2 |
11 files changed, 97 insertions, 97 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc index 04bed2b..c549ac9 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -23,7 +23,7 @@ oneTimeSetUp() { build=true for a in ${pkgarch[@]}; do for p in ${pkgname[@]}; do - [ ! -f ${p}-${pkgversion}-${a}${PKGEXT} ] && build=false + [ ! -f ${p}-${pkgversion}-${a}${package_extension_suffixfile} ] && build=false done done @@ -37,7 +37,7 @@ oneTimeSetUp() { fi for a in ${pkgarch[@]}; do for p in ${pkgname[@]}; do - cp ${p}-${pkgversion}-${a}${PKGEXT} $(dirname ${BASH_SOURCE[0]})/../packages/$(basename ${d}) + cp ${p}-${pkgversion}-${a}${package_extension_suffixfile} $(dirname ${BASH_SOURCE[0]})/../packages/$(basename ${d}) done done fi @@ -56,52 +56,52 @@ setUp() { local a [ -f "$(dirname ${BASH_SOURCE[0]})/../../config.local" ] && die "$(dirname ${BASH_SOURCE[0]})/../../config.local exists" - TMP="$(mktemp -d /dev/shm/$(basename $0).XXXXXXXXXX)" - #msg "Using ${TMP}" + temporary_directory="$(mktemp -d /dev/shm/$(basename $0).XXXXXXXXXX)" + #msg "Using ${temporary_directory}" PKGREPOS=('core' 'extra' 'testing') PKGPOOL='pool/packages' - mkdir -p "${TMP}/"{ftp,tmp,staging,{package,source}-cleanup,svn-packages-{copy,repo}} + mkdir -p "${temporary_directory}/"{ftp,tmp,staging,{package,source}-cleanup,svn-packages-{copy,repo}} for r in ${PKGREPOS[@]}; do - mkdir -p "${TMP}/staging/${r}" + mkdir -p "${temporary_directory}/staging/${r}" for a in ${ARCHES[@]} any; do - mkdir -p "${TMP}/ftp/${r}/os/${a}" + mkdir -p "${temporary_directory}/ftp/${r}/os/${a}" done done - mkdir -p "${TMP}/ftp/${PKGPOOL}" - mkdir -p "${TMP}/ftp/${SRCPOOL}" + mkdir -p "${temporary_directory}/ftp/${PKGPOOL}" + mkdir -p "${temporary_directory}/ftp/${SRCPOOL}" msg 'Creating svn repository...' - svnadmin create "${TMP}/svn-packages-repo" - svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy" + svnadmin create "${temporary_directory}/svn-packages-repo" + svn checkout -q "file://${temporary_directory}/svn-packages-repo" "${temporary_directory}/svn-packages-copy" for p in "${pkgdir}"/*; do pkg=$(basename $p) - mkdir -p "${TMP}/svn-packages-copy/${pkg}"/{trunk,repos} - cp "${p}"/* "${TMP}/svn-packages-copy"/${pkg}/trunk/ - svn add -q "${TMP}/svn-packages-copy"/${pkg} - svn commit -q -m"initial commit of ${pkg}" "${TMP}/svn-packages-copy" + mkdir -p "${temporary_directory}/svn-packages-copy/${pkg}"/{trunk,repos} + cp "${p}"/* "${temporary_directory}/svn-packages-copy"/${pkg}/trunk/ + svn add -q "${temporary_directory}/svn-packages-copy"/${pkg} + svn commit -q -m"initial commit of ${pkg}" "${temporary_directory}/svn-packages-copy" done cat <<eot > "$(dirname ${BASH_SOURCE[0]})/../../config.local" - root_dir="${TMP}/ftp" - SVNREPO="file://${TMP}/svn-packages-repo" + root_dir="${temporary_directory}/ftp" + SVN_repository="file://${temporary_directory}/svn-packages-repo" PKGREPOS=(${PKGREPOS[@]}) PKGPOOL="${PKGPOOL}" - CLEANUP_DESTDIR="${TMP}/package-cleanup" - SOURCE_CLEANUP_DESTDIR="${TMP}/source-cleanup" - STAGING="${TMP}/staging" - TMPDIR="${TMP}/tmp" - CLEANUP_DRYRUN=false - SOURCE_CLEANUP_DRYRUN=false - REQUIRE_SIGNATURE=true + cleanup_destination_directory="${temporary_directory}/package-cleanup" + source_cleanup_destination_directory="${temporary_directory}/source-cleanup" + staging_directory="${temporary_directory}/staging" + temporary_directory="${temporary_directory}/tmp" + cleanup_dryrun=false + source_cleanup_dryrun=false + require_signature=true eot . "$(dirname ${BASH_SOURCE[0]})/../../config" } tearDown() { - rm -rf "${TMP}" + rm -rf "${temporary_directory}" rm -f "$(dirname ${BASH_SOURCE[0]})/../../config.local" echo } @@ -111,16 +111,16 @@ releasePackage() { local pkgbase=$2 local arch=$3 - pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null + pushd "${temporary_directory}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null archrelease ${repo}-${arch} >/dev/null 2&>1 pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) popd >/dev/null - cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/ + cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${package_extension_suffixfile} "${staging_directory}"/${repo}/ - if ${REQUIRE_SIGNATURE}; then + if ${require_signature}; then # TODO: really sign the packages with a valid key - find "${STAGING}"/${repo}/ -type f \ - -name "*-${pkgver}-${arch}${PKGEXT}" \ + find "${staging_directory}"/${repo}/ -type f \ + -name "*-${pkgver}-${arch}${package_extension_suffixfile}" \ -exec touch {}.sig \; fi } @@ -132,7 +132,7 @@ checkAnyPackageDB() { local db [ -r "${root_dir}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found" - if ${REQUIRE_SIGNATURE}; then + if ${require_signature}; then [ -r "${root_dir}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found" fi @@ -141,16 +141,16 @@ checkAnyPackageDB() { [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}")" == "${root_dir}/${PKGPOOL}/${pkg}" ] \ || fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}" - if ${REQUIRE_SIGNATURE}; then + if ${require_signature}; then [ -L "${root_dir}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink" [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}.sig")" == "${root_dir}/${PKGPOOL}/${pkg}.sig" ] \ || fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig" fi done - [ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir" - [ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir" + [ -r "${staging_directory}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging directory" + [ -r "${staging_directory}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging directory" - for db in ${DBEXT} ${FILESEXT}; do + for db in ${database_extension_suffixfile} ${files_extension_suffixfile}; do ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \ || fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}" @@ -167,8 +167,8 @@ checkAnyPackage() { checkAnyPackageDB $repo $pkg local pkgbase=$(getpkgbase "${root_dir}/${PKGPOOL}/${pkg}") - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" - [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ + svn up -q "${temporary_directory}/svn-packages-copy/${pkgbase}" + [ -d "${temporary_directory}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ || fail "svn-packages-copy/${pkgbase}/repos/${repo}-any does not exist" } @@ -180,21 +180,21 @@ checkPackageDB() { [ -r "${root_dir}/${PKGPOOL}/${pkg}" ] || fail "${PKGPOOL}/${pkg} not found" [ -L "${root_dir}/${repo}/os/${arch}/${pkg}" ] || fail "${repo}/os/${arch}/${pkg} not a symlink" - [ -r "${STAGING}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging dir" + [ -r "${staging_directory}"/${repo}/${pkg} ] && fail "${repo}/${pkg} found in staging directory" [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}")" == "${root_dir}/${PKGPOOL}/${pkg}" ] \ || fail "${repo}/os/${arch}/${pkg} does not link to ${PKGPOOL}/${pkg}" - if ${REQUIRE_SIGNATURE}; then + if ${require_signature}; then [ -r "${root_dir}/${PKGPOOL}/${pkg}.sig" ] || fail "${PKGPOOL}/${pkg}.sig not found" [ -L "${root_dir}/${repo}/os/${arch}/${pkg}.sig" ] || fail "${repo}/os/${arch}/${pkg}.sig is not a symlink" - [ -r "${STAGING}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging dir" + [ -r "${staging_directory}"/${repo}/${pkg}.sig ] && fail "${repo}/${pkg}.sig found in staging directory" [ "$(readlink -e "${root_dir}/${repo}/os/${arch}/${pkg}.sig")" == "${root_dir}/${PKGPOOL}/${pkg}.sig" ] \ || fail "${repo}/os/${arch}/${pkg}.sig does not link to ${PKGPOOL}/${pkg}.sig" fi - for db in ${DBEXT} ${FILESEXT}; do + for db in ${database_extension_suffixfile} ${files_extension_suffixfile}; do ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkg}) \ || fail "${pkg} not in ${repo}/os/${arch}/${repo}${db%.tar.*}" @@ -209,8 +209,8 @@ checkPackage() { checkPackageDB $repo $pkg $arch local pkgbase=$(getpkgbase "${root_dir}/${PKGPOOL}/${pkg}") - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" - [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ + svn up -q "${temporary_directory}/svn-packages-copy/${pkgbase}" + [ -d "${temporary_directory}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ || fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} does not exist" } @@ -220,7 +220,7 @@ checkRemovedPackageDB() { local arch=$3 local db - for db in ${DBEXT} ${FILESEXT}; do + for db in ${database_extension_suffixfile} ${files_extension_suffixfile}; do ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \ && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${db%.tar.*}" @@ -234,8 +234,8 @@ checkRemovedPackage() { checkRemovedPackageDB $repo $pkgbase $arch - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" - [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ + svn up -q "${temporary_directory}/svn-packages-copy/${pkgbase}" + [ -d "${temporary_directory}/svn-packages-copy/${pkgbase}/repos/${repo}-${arch}" ] \ && fail "svn-packages-copy/${pkgbase}/repos/${repo}-${arch} should not exist" } @@ -245,7 +245,7 @@ checkRemovedAnyPackageDB() { local arch local db - for db in ${DBEXT} ${FILESEXT}; do + for db in ${database_extension_suffixfile} ${files_extension_suffixfile}; do for arch in i686 x86_64; do ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" ] \ && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${db%.tar.*}" -O | grep -q ${pkgbase}) \ @@ -260,7 +260,7 @@ checkRemovedAnyPackage() { checkRemovedAnyPackageDB $repo $pkgbase - svn up -q "${TMP}/svn-packages-copy/${pkgbase}" - [ -d "${TMP}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ + svn up -q "${temporary_directory}/svn-packages-copy/${pkgbase}" + [ -d "${temporary_directory}/svn-packages-copy/${pkgbase}/repos/${repo}-any" ] \ && fail "svn-packages-copy/${pkgbase}/repos/${repo}-any should not exist" } diff --git a/test/lib/shunit2 b/test/lib/shunit2 index 8862ffd..1462562 100755 --- a/test/lib/shunit2 +++ b/test/lib/shunit2 @@ -698,7 +698,7 @@ _shunit_mktempDir() _shunit_random_=`expr ${_shunit_date_} / $$` fi - _shunit_tmpDir_="${TMPDIR:-/tmp}/shunit.${_shunit_random_}" + _shunit_tmpDir_="${temporary_directory:-/tmp}/shunit.${_shunit_random_}" ( umask 077 && mkdir "${_shunit_tmpDir_}" ) || \ _shunit_fatal 'could not create temporary directory! exiting' @@ -995,8 +995,8 @@ __shunit_tmpDir=`_shunit_mktempDir` # provide a public temporary directory for unit test scripts # TODO(kward): document this -SHUNIT_TMPDIR="${__shunit_tmpDir}/tmp" -mkdir "${SHUNIT_TMPDIR}" +SHUNIT_temporary_directory="${__shunit_tmpDir}/tmp" +mkdir "${SHUNIT_temporary_directory}" # setup traps to clean up after ourselves trap '_shunit_cleanup EXIT' 0 @@ -1008,10 +1008,10 @@ _shunit_mktempFunc PATH="${__shunit_tmpDir}:${PATH}" # make sure phantom functions are executable. this will bite if /tmp (or the -# current $TMPDIR) points to a path on a partition that was mounted with the +# current $temporary_directory) points to a path on a partition that was mounted with the # 'noexec' option. the noexec command was created with _shunit_mktempFunc(). noexec 2>/dev/null || _shunit_fatal \ - 'please declare TMPDIR with path on partition with exec permission' + 'please declare temporary_directory with path on partition with exec permission' # we must manually source the tests in standalone mode if [ "${__shunit_mode}" = "${__SHUNIT_MODE_STANDALONE}" ]; then diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 3e27d64..c1f43e9 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -18,8 +18,8 @@ testCreateSimpleFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgbase}"; then - fail "usr/bin/${pkgbase} not found in ${arch}/extra${FILESEXT}" + if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${files_extension_suffixfile}" | grep -q "usr/bin/${pkgbase}"; then + fail "usr/bin/${pkgbase} not found in ${arch}/extra${files_extension_suffixfile}" fi done done @@ -38,8 +38,8 @@ testCreateAnyFileLists() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/share/${pkgbase}/test"; then - fail "usr/share/${pkgbase}/test not found in ${arch}/extra${FILESEXT}" + if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${files_extension_suffixfile}" | grep -q "usr/share/${pkgbase}/test"; then + fail "usr/share/${pkgbase}/test not found in ${arch}/extra${files_extension_suffixfile}" fi done done @@ -62,11 +62,11 @@ testCreateSplitFileLists() { ../db-update for pkgbase in ${pkgs[@]}; do - pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) + pkgnames=($(source "${temporary_directory}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo ${pkgname[@]})) for pkgname in ${pkgnames[@]}; do for arch in ${arches[@]}; do - if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/${pkgname}"; then - fail "usr/bin/${pkgname} not found in ${arch}/extra${FILESEXT}" + if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${files_extension_suffixfile}" | grep -q "usr/bin/${pkgname}"; then + fail "usr/bin/${pkgname} not found in ${arch}/extra${files_extension_suffixfile}" fi done done @@ -92,11 +92,11 @@ testCleanupFileLists() { done for arch in ${arches[@]}; do - if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-b"; then - fail "usr/bin/pkg-simple-b not found in ${arch}/extra${FILESEXT}" + if ! bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${files_extension_suffixfile}" | grep -q "usr/bin/pkg-simple-b"; then + fail "usr/bin/pkg-simple-b not found in ${arch}/extra${files_extension_suffixfile}" fi - if bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${FILESEXT}" | grep -q "usr/bin/pkg-simple-a"; then - fail "usr/bin/pkg-simple-a still found in ${arch}/extra${FILESEXT}" + if bsdtar -xOf "${root_dir}/extra/os/${arch}/extra${files_extension_suffixfile}" | grep -q "usr/bin/pkg-simple-a"; then + fail "usr/bin/pkg-simple-a still found in ${arch}/extra${files_extension_suffixfile}" fi done diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 9d7c1f6..04c8113 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -106,12 +106,12 @@ testMoveSplitPackages() { ../db-move testing extra pkg-split-a for arch in ${arches[@]}; do - for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/pkg-split-a"/*-${arch}${package_extension_suffixfile}; do checkPackage extra $(basename ${pkg}) ${arch} done done for arch in ${arches[@]}; do - for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/pkg-split-b"/*-${arch}${package_extension_suffixfile}; do checkPackage testing $(basename ${pkg}) ${arch} done done diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index c0b7501..3ce9037 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -68,7 +68,7 @@ testAddSplitPackages() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${package_extension_suffixfile}; do checkPackage extra $(basename ${pkg}) ${arch} done done @@ -79,7 +79,7 @@ testUpdateAnyPackage() { releasePackage extra pkg-any-a any ../db-update - pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null + pushd "${temporary_directory}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build >/dev/null 2>&1 @@ -97,7 +97,7 @@ testUpdateAnyPackage() { testUpdateAnyPackageToDifferentRepositoriesAtOnce() { releasePackage extra pkg-any-a any - pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null + pushd "${temporary_directory}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build >/dev/null 2>&1 @@ -133,9 +133,9 @@ testUpdateSameAnyPackageToDifferentRepositories() { local arch for arch in i686 x86_64; do - ( [ -r "${root_dir}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${root_dir}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ - && fail "${pkgbase} should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" + ( [ -r "${root_dir}/testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" ] \ + && bsdtar -xf "${root_dir}/testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" -O | grep -q ${pkgbase}) \ + && fail "${pkgbase} should not be in testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" done } @@ -151,14 +151,14 @@ testAddIncompleteSplitPackage() { done # remove a split package to make db-update fail - rm "${STAGING}"/extra/${pkgbase}1-* + rm "${staging_directory}"/extra/${pkgbase}1-* ../db-update >/dev/null 2>&1 && fail "db-update should fail when a split package is missing!" for arch in ${arches[@]}; do - ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" -O | grep -q ${pkgbase}) \ - && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${DBEXT%.tar.*}" + ( [ -r "${root_dir}/${repo}/os/${arch}/${repo}${database_extension_suffixfile%.tar.*}" ] \ + && bsdtar -xf "${root_dir}/${repo}/os/${arch}/${repo}${database_extension_suffixfile%.tar.*}" -O | grep -q ${pkgbase}) \ + && fail "${pkgbase} should not be in ${repo}/os/${arch}/${repo}${database_extension_suffixfile%.tar.*}" done } diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index ad88484..4e7e1f5 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -106,13 +106,13 @@ testCleanupSplitPackages() { ../cron-jobs/ftpdir-cleanup >/dev/null for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-${arch}${package_extension_suffixfile}; do checkRemovedPackage extra ${pkgs[0]} ${arch} [ -f "${root_dir}/${PKGPOOL}/${pkg}" ] && fail "${PKGPOOL}/${pkg} found" [ -f "${root_dir}/${repo}/os/${arch}/${pkg}" ] && fail "${repo}/os/${arch}/${pkg} found" done - for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/${pkgs[1]}"/*-${arch}${package_extension_suffixfile}; do checkPackage extra $(basename ${pkg}) ${arch} done done diff --git a/test/test.d/packages.sh b/test/test.d/packages.sh index 488cb15..5028448 100755 --- a/test/test.d/packages.sh +++ b/test/test.d/packages.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testPackages() { # TODO: namcap -r sodepends fails with i686 packages - find "${pkgdir}" -name "*${PKGEXT}" -exec namcap -e sodepends,pkgnameindesc {} + || fail 'namcap failed' + find "${pkgdir}" -name "*${package_extension_suffixfile}" -exec namcap -e sodepends,pkgnameindesc {} + || fail 'namcap failed' } . "${curdir}/../lib/shunit2" diff --git a/test/test.d/pool-transition.sh b/test/test.d/pool-transition.sh index e91eed3..9f13d83 100755 --- a/test/test.d/pool-transition.sh +++ b/test/test.d/pool-transition.sh @@ -22,7 +22,7 @@ testMovePackagesWithoutPool() { # transform two packages to old style layout for arch in ${arches[@]}; do for old in 0 2; do - for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/${pkgs[${old}]}"/*-${arch}${package_extension_suffixfile}; do pkg=$(basename $pkg) mv -f "${root_dir}/${PKGPOOL}/${pkg}" "${root_dir}/testing/os/${arch}/${pkg}" done @@ -37,7 +37,7 @@ testMovePackagesWithoutPool() { for pkgbase in ${pkgs[@]}; do for arch in ${arches[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${PKGEXT}; do + for pkg in "${pkgdir}/${pkgbase}"/*-${arch}${package_extension_suffixfile}; do checkPackage extra $(basename ${pkg}) ${arch} done checkRemovedPackage testing ${pkgbase} ${arch} @@ -60,7 +60,7 @@ testUpdateAnyPackageWithoutPool() { ln -sf "../any/${pkg1}" "${root_dir}/extra/os/${arch}" done - pushd "${TMP}/svn-packages-copy/${pkgname}/trunk/" >/dev/null + pushd "${temporary_directory}/svn-packages-copy/${pkgname}/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build >/dev/null 2>&1 @@ -94,7 +94,7 @@ testMoveAnyPackagesWithoutPool() { ../db-update # transform a package to old style layout - for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-any${package_extension_suffixfile}; do pkg=$(basename $pkg) mv -f "${root_dir}/${PKGPOOL}/${pkg}" "${root_dir}/testing/os/any/${pkg}" for arch in i686 x86_64; do @@ -109,13 +109,13 @@ testMoveAnyPackagesWithoutPool() { ../cron-jobs/ftpdir-cleanup >/dev/null for pkgbase in ${pkgs[@]}; do - for pkg in "${pkgdir}/${pkgbase}"/*-any${PKGEXT}; do + for pkg in "${pkgdir}/${pkgbase}"/*-any${package_extension_suffixfile}; do checkAnyPackage extra $(basename ${pkg}) done checkRemovedAnyPackage testing ${pkgbase} done - for pkg in "${pkgdir}/${pkgs[0]}"/*-any${PKGEXT}; do + for pkg in "${pkgdir}/${pkgs[0]}"/*-any${package_extension_suffixfile}; do pkg=$(basename $pkg) for arch in any i686 x86_64; do [ -f "${root_dir}/testing/os/${arch}/${pkg}" ] && fail "testing/os/${arch}/${pkg} found" @@ -131,7 +131,7 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { ../db-update # transform a package to old style layout - for pkg in "${pkgdir}/pkg-any-a"/*-any${PKGEXT}; do + for pkg in "${pkgdir}/pkg-any-a"/*-any${package_extension_suffixfile}; do pkg=$(basename $pkg) mv -f "${root_dir}/${PKGPOOL}/${pkg}" "${root_dir}/extra/os/any/${pkg}" for arch in i686 x86_64; do @@ -143,9 +143,9 @@ testUpdateSameAnyPackageToDifferentRepositoriesWithoutPool() { ../db-update >/dev/null 2>&1 && (fail 'Adding an existing package to another repository should fail'; return 1) for arch in i686 x86_64; do - ( [ -r "${root_dir}/testing/os/${arch}/testing${DBEXT%.tar.*}" ] \ - && bsdtar -xf "${root_dir}/testing/os/${arch}/testing${DBEXT%.tar.*}" -O | grep -q pkg-any-a) \ - && fail "pkg-any-a should not be in testing/os/${arch}/testing${DBEXT%.tar.*}" + ( [ -r "${root_dir}/testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" ] \ + && bsdtar -xf "${root_dir}/testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" -O | grep -q pkg-any-a) \ + && fail "pkg-any-a should not be in testing/os/${arch}/testing${database_extension_suffixfile%.tar.*}" done } diff --git a/test/test.d/signed-packages.sh b/test/test.d/signed-packages.sh index 5d6f4ff..d7c5e57 100755 --- a/test/test.d/signed-packages.sh +++ b/test/test.d/signed-packages.sh @@ -6,7 +6,7 @@ curdir=$(readlink -e $(dirname $0)) testAddUnsignedPackage() { releasePackage extra 'pkg-simple-a' 'i686' # remove any signature - rm "${STAGING}"/extra/*.sig + rm "${staging_directory}"/extra/*.sig ../db-update >/dev/null 2>&1 && fail "db-update should fail when a signature is missing!" } diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index 9e8cb26..a34093a 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -18,7 +18,7 @@ testSourceballs() { ../cron-jobs/sourceballs for pkgbase in ${pkgs[@]}; do - [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!" + [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${source_extension_suffixfile} ] && fail "source package not found!" done } @@ -33,7 +33,7 @@ testAnySourceballs() { ../cron-jobs/sourceballs for pkgbase in ${pkgs[@]}; do - [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!" + [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${source_extension_suffixfile} ] && fail "source package not found!" done } @@ -54,7 +54,7 @@ testSplitSourceballs() { ../cron-jobs/sourceballs for pkgbase in ${pkgs[@]}; do - [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${SRCEXT} ] && fail "source package not found!" + [ ! -r ${root_dir}/${SRCPOOL}/${pkgbase}-*${source_extension_suffixfile} ] && fail "source package not found!" done } @@ -77,8 +77,8 @@ testSourceballsCleanup() { done ../cron-jobs/sourceballs - [ -r ${root_dir}/${SRCPOOL}/pkg-simple-a-*${SRCEXT} ] && fail "source package was not removed!" - [ ! -r ${root_dir}/${SRCPOOL}/pkg-simple-b-*${SRCEXT} ] && fail "source package not found!" + [ -r ${root_dir}/${SRCPOOL}/pkg-simple-a-*${source_extension_suffixfile} ] && fail "source package was not removed!" + [ ! -r ${root_dir}/${SRCPOOL}/pkg-simple-b-*${source_extension_suffixfile} ] && fail "source package not found!" } . "${curdir}/../lib/shunit2" diff --git a/test/test.d/testing2x.sh b/test/test.d/testing2x.sh index eda6cd6..d0d08d5 100755 --- a/test/test.d/testing2x.sh +++ b/test/test.d/testing2x.sh @@ -7,7 +7,7 @@ testTesting2xAnyPackage() { releasePackage core pkg-any-a any ../db-update - pushd "${TMP}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null + pushd "${temporary_directory}/svn-packages-copy/pkg-any-a/trunk/" >/dev/null sed 's/pkgrel=1/pkgrel=2/g' -i PKGBUILD svn commit -q -m"update pkg to pkgrel=2" >/dev/null sudo extra-i686-build >/dev/null 2>&1 |