-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rather than generating test scripts via bmake, just directly write .bats files, and make them self-contained rather than depending on a previous run to simplify things and make them easier to extend. It was getting very difficult to maintain, as any minor change to add a new test required lots of changes to each repository and exp files. Now each individual *.bats test suite can be run independently, and the only variable that the user needs to set if necessary is PKGIN to point at the binary to test. While here rewrite a bunch of tests to make more sense now that they aren't linked together. Hopefully no tests have been lost, this has been tested against a bunch of different versions. There may still be some cleanups to find.
- Loading branch information
Jonathan Perkin
committed
Oct 21, 2020
1 parent
df5fca5
commit 800afb2
Showing
71 changed files
with
2,515 additions
and
1,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkg_add(1). | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
pkg_add -K ${PKG_DBDIR} -C /dev/null "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkg_admin(1). | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
pkg_admin -K ${PKG_DBDIR} -C /dev/null "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkg_create(1). | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
pkg_create -K ${PKG_DBDIR} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkg_delete(1). | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
pkg_delete -K ${PKG_DBDIR} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkg_info(1). | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
pkg_info -K ${PKG_DBDIR} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper script for pkgin(1) | ||
# | ||
|
||
set -eu | ||
|
||
if [ ${BATS_PKGIN_TEST_SUITE} -ne 1 ]; then | ||
echo "ERROR: BATS_PKGIN_TEST_SUITE is not set." >&2 | ||
echo "This script only works in the pkgin-test-suite environment" >&2 | ||
exit 1 | ||
fi | ||
|
||
env PKGIN_DBDIR="${PKGIN_DBDIR}" \ | ||
PKG_INSTALL_DIR="${PKG_INSTALL_DIR}" \ | ||
PKG_DBDIR="${PKG_DBDIR}" \ | ||
${PKGIN} "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
deptree-bottom-1.0 Package is at the bottom of a dependency tree | ||
deptree-middle-2.0 Package is in the middle of a dependency tree | ||
deptree-top-2.0 Package is at the top of a dependency tree | ||
keep-1.0 Package should remain at all times | ||
pkgpath-2.0 Package should not be upgraded by newer pkgpath | ||
upgrade-2.0 Package should be upgraded over older upgrade package | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
keep-[0-9]* | ||
preserve-[0-9]* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
download-ok-1.0 Package tests download success | ||
keep-1.0 Package should remain at all times | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
download-ok-1.0 Package tests download success | ||
keep-1.0 Package should remain at all times | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
processing remote summary .http://.* | ||
downloading pkg_summary.* done. | ||
calculating dependencies...done. | ||
5 packages to install: | ||
4 packages to install: | ||
.* | ||
0 to refresh, 0 to upgrade, 5 to install | ||
[0-9]+[BK] to download, 78B to install | ||
0 to refresh, 0 to upgrade, 4 to install | ||
[0-9]+[BK] to download, [0-9]+[BK] to install | ||
downloading deptree-bottom-1.0.tgz done. | ||
downloading deptree-middle-1.0.tgz done. | ||
downloading deptree-top-1.0.tgz done. | ||
downloading pkgpath-1.0.tgz done. | ||
downloading upgrade-1.0.tgz done. | ||
installing deptree-bottom-1.0... | ||
installing deptree-middle-1.0... | ||
installing deptree-top-1.0... | ||
installing pkgpath-1.0... | ||
installing upgrade-1.0... | ||
pkg_install warnings: 0, errors: 0 | ||
reading local summary... | ||
processing local summary... | ||
marking pkgpath-1.0 as non auto-removable | ||
marking upgrade-1.0 as non auto-removable | ||
marking deptree-top-1.0 as non auto-removable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
deptree-bottom-1.0 | ||
deptree-middle-1.0 | ||
deptree-top-1.0 | ||
keep-1.0 | ||
preserve-1.0 | ||
pkgpath-1.0 | ||
upgrade-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
deptree-bottom-1.0 | ||
deptree-middle-1.0 | ||
deptree-top-1.0 | ||
keep-1.0 | ||
pkgpath-1.0 | ||
upgrade-1.0 | ||
preserve-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
processing remote summary .http://.* | ||
downloading pkg_summary.* done. | ||
calculating dependencies...done. | ||
5 packages to install: | ||
.* | ||
0 to refresh, 0 to upgrade, 5 to install | ||
[0-9]+[BK] to download, [0-9]+[BK] to install | ||
downloading preserve-1.0.tgz done. | ||
downloading pkgpath-1.0.tgz done. | ||
downloading deptree-bottom-1.0.tgz done. | ||
downloading deptree-middle-1.0.tgz done. | ||
downloading deptree-top-1.0.tgz done. | ||
installing preserve-1.0... | ||
installing pkgpath-1.0... | ||
installing deptree-top-1.0... | ||
installing deptree-middle-1.0... | ||
installing deptree-bottom-1.0... | ||
pkg_install warnings: 0, errors: 0 | ||
reading local summary... | ||
processing local summary... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
deptree-bottom-1.0 Package is at the bottom of a dependency tree | ||
deptree-middle-1.0 Package is in the middle of a dependency tree | ||
deptree-top-1.0 Package is at the top of a dependency tree | ||
keep-1.0 Package should remain at all times | ||
pkgpath-1.0 Package should not be upgraded by newer pkgpath | ||
upgrade-1.0 Package should be upgraded to newer upgrade | ||
pkgpath-1.0 PKGPATH differs to pkgpath-2.0 | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
keep-1.0 Package should remain at all times | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
deptree-bottom-1.0 Package is at the bottom of a dependency tree | ||
deptree-middle-1.0 Package is in the middle of a dependency tree | ||
deptree-top-1.0 Package is at the top of a dependency tree | ||
keep-1.0 Package should remain at all times | ||
pkgpath-1.0 Package should not be upgraded by newer pkgpath | ||
upgrade-1.0 Package should be upgraded to newer upgrade | ||
pkgpath-1.0 PKGPATH differs to pkgpath-2.0 | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
keep-1.0 Package should remain at all times | ||
preserve-1.0 Package should remain at all times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Local package database: | ||
Installed packages: 6 | ||
Disk space occupied: 87B | ||
Installed packages: 5 | ||
Disk space occupied: [0-9]+[BK] | ||
Remote package database.s.: | ||
Number of repositories: 1 | ||
Packages available: 6 | ||
Total size of packages: [0-9]+K | ||
Total size of packages: [0-9]+[BK] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
testsuite/deptree-top | ||
testsuite/keep | ||
testsuite/pkgpath1 | ||
testsuite/upgrade | ||
cat1/preserve | ||
cat2/pkgpath1 | ||
cat3/deptree-top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
full dependency tree for deptree-top-1.0 | ||
keep>=1.0 | ||
preserve>=1.0 | ||
deptree-bottom-[0-9]* | ||
deptree-middle>=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
deptree-top-1.0 is marked as non-autoremovable | ||
keep-1.0 is marked as non-autoremovable | ||
pkgpath-1.0 is marked as non-autoremovable | ||
upgrade-1.0 is marked as non-autoremovable | ||
preserve-1.0 is marked as non-autoremovable |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
preserve-1.0 Package should remain at all times | ||
provides-1.0 Package provides libprovides.so | ||
requires-1.0 Package requires libprovides.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.