From a791b1ce0fa2bc9859474fb6f7a9c0ff8cbd1d4a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 Feb 2017 00:58:53 +0300 Subject: Port test.sh to testscript --- bpkg/types | 6 +- build/export.build | 10 + buildfile | 5 +- tests/auth.test | 23 + tests/auth/cert | 36 + tests/auth/default-cert-fp | 1 + tests/auth/default-cert.pem | 30 + tests/auth/default-openssl.cnf | 22 + tests/auth/expired-cert.pem | 30 + tests/auth/key.pem | 51 + tests/auth/mismatch-cert.pem | 31 + tests/auth/mismatch-openssl.cnf | 22 + tests/auth/noemail-cert.pem | 30 + tests/auth/noemail-openssl.cnf | 20 + tests/build/.gitignore | 1 + tests/build/bootstrap.build | 9 + tests/build/root.build | 17 + tests/buildfile | 12 + tests/cert.sh | 46 - tests/cfg-create.test | 75 + tests/common.test | 41 + tests/common/bar/stable/libbar-1.0.0.tar.gz | Bin 0 -> 957 bytes tests/common/bar/stable/repositories | 6 + tests/common/bar/testing/libbar-1.1.0.tar.gz | Bin 0 -> 959 bytes tests/common/bar/testing/repositories | 8 + tests/common/bar/unstable/libbar-1.1.1.tar.gz | Bin 0 -> 1189 bytes tests/common/bar/unstable/repositories | 8 + tests/common/foo-1.tar.gz | Bin 0 -> 261 bytes tests/common/foo/stable/libfoo-1.0.0.tar.gz | Bin 0 -> 881 bytes tests/common/foo/stable/repositories | 3 + tests/common/foo/testing/libfoo-1.1.0.tar.gz | Bin 0 -> 874 bytes tests/common/foo/testing/repositories | 6 + tests/common/hello/libhello-1.0.0.tar.gz | Bin 0 -> 2483 bytes tests/common/hello/repositories | 4 + tests/common/libfoo-1.1.0/build/bootstrap.build | 2 + tests/common/libfoo-1.1.0/buildfile | 1 + tests/common/libfoo-1.1.0/manifest | 7 + tests/common/libhello-1.0.0/INSTALL | 1 + tests/common/libhello-1.0.0/build/bootstrap.build | 22 + tests/common/libhello-1.0.0/build/export.build | 6 + tests/common/libhello-1.0.0/build/root.build | 6 + tests/common/libhello-1.0.0/buildfile | 8 + tests/common/libhello-1.0.0/hello/buildfile | 21 + tests/common/libhello-1.0.0/hello/export | 36 + tests/common/libhello-1.0.0/hello/hello | 13 + tests/common/libhello-1.0.0/hello/hello.cxx | 16 + tests/common/libhello-1.0.0/manifest | 14 + .../libhello-1.0.0/tests/build/bootstrap.build | 5 + tests/common/libhello-1.0.0/tests/build/root.build | 14 + tests/common/libhello-1.0.0/tests/buildfile | 3 + tests/common/libhello-1.0.0/tests/test/buildfile | 4 + tests/common/libhello-1.0.0/tests/test/driver.cxx | 11 + tests/common/libhello-1.0.0/tests/test/test.out | 1 + tests/common/libhello-1.0.0/version | 1 + tests/common/satisfy/libbar-1.0.0.tar.gz | Bin 0 -> 356 bytes tests/common/satisfy/libbar-1.1.0.tar.gz | Bin 0 -> 360 bytes tests/common/satisfy/libbar-1.2.0.tar.gz | Bin 0 -> 348 bytes tests/common/satisfy/libbaz-1.0.0.tar.gz | Bin 0 -> 359 bytes tests/common/satisfy/libbaz-1.1.0.tar.gz | Bin 0 -> 363 bytes tests/common/satisfy/libbiz-1.0.0.tar.gz | Bin 0 -> 366 bytes tests/common/satisfy/libfoo-0.0.1.tar.gz | Bin 0 -> 352 bytes tests/common/satisfy/libfoo-1.0.0.tar.gz | Bin 0 -> 348 bytes tests/common/satisfy/libfoo-1.1.0.tar.gz | Bin 0 -> 349 bytes .../satisfy/libfoo-1.1.0/build/bootstrap.build | 2 + tests/common/satisfy/libfoo-1.1.0/buildfile | 1 + tests/common/satisfy/libfoo-1.1.0/manifest | 7 + tests/common/satisfy/libfoo-1.2.0.tar.gz | Bin 0 -> 350 bytes tests/common/satisfy/libfox-1.0.0.tar.gz | Bin 0 -> 349 bytes tests/common/satisfy/repositories | 1 + tests/common/satisfy/t1/libfoo-1.0.0.tar.gz | 1 + tests/common/satisfy/t1/repositories | 1 + tests/common/satisfy/t2/libbar-1.0.0.tar.gz | 1 + tests/common/satisfy/t2/libfoo-1.0.0.tar.gz | 1 + tests/common/satisfy/t2/repositories | 1 + tests/common/satisfy/t3/libbaz-1.0.0.tar.gz | 1 + tests/common/satisfy/t3/libfox-1.0.0.tar.gz | 1 + tests/common/satisfy/t3/repositories | 4 + tests/common/satisfy/t4a/libfoo-1.1.0.tar.gz | 1 + tests/common/satisfy/t4a/repositories | 1 + tests/common/satisfy/t4b/libbar-1.1.0.tar.gz | 1 + tests/common/satisfy/t4b/repositories | 3 + tests/common/satisfy/t4c/libbaz-1.1.0.tar.gz | 1 + tests/common/satisfy/t4c/libfoo-1.0.0.tar.gz | 1 + tests/common/satisfy/t4c/repositories | 3 + tests/common/satisfy/t4d/libbiz-1.0.0.tar.gz | 1 + tests/common/satisfy/t4d/libfox-1.0.0.tar.gz | 1 + tests/common/satisfy/t4d/repositories | 3 + tests/common/satisfy/t5/libbar-1.2.0.tar.gz | 1 + tests/common/satisfy/t5/repositories | 1 + tests/common/t1/libfoo-1.0.0.tar.gz | Bin 0 -> 348 bytes tests/common/t1/libfoo-1.1.0.tar.gz | Bin 0 -> 349 bytes tests/common/t1/repositories | 1 + tests/config.test | 27 + tests/default-openssl.cnf | 22 - tests/key.pem | 51 - tests/mismatch-openssl.cnf | 22 - tests/noemail-openssl.cnf | 20 - tests/pkg-build.test | 1239 ++++++++++++ tests/pkg-build/libbar-1.0.0.tar.gz | 1 + tests/pkg-build/libbaz-1.1.0.tar.gz | 1 + tests/pkg-build/libfoo-0.0.1.tar.gz | 1 + tests/pkg-build/libfoo-1.0.0.tar.gz | 1 + tests/pkg-build/libfoo-1.1.0 | 1 + tests/pkg-build/libfoo-1.1.0.tar.gz | 1 + tests/pkg-build/libfoo-1.2.0.tar.gz | 1 + tests/pkg-build/t1 | 1 + tests/pkg-build/t2 | 1 + tests/pkg-build/t3 | 1 + tests/pkg-build/t4a | 1 + tests/pkg-build/t4b | 1 + tests/pkg-build/t4c | 1 + tests/pkg-build/t4d | 1 + tests/pkg-build/t5 | 1 + tests/pkg-clean.test | 133 ++ tests/pkg-clean/hello | 1 + tests/pkg-clean/libhello-1.0.0 | 1 + tests/pkg-configure.test | 389 ++++ tests/pkg-configure/hello | 1 + tests/pkg-configure/libhello-1.0.0 | 1 + tests/pkg-configure/stable/libbar-1.0.0.tar.gz | Bin 0 -> 354 bytes tests/pkg-configure/stable/libbar-1.1.0.tar.gz | Bin 0 -> 359 bytes tests/pkg-configure/stable/libbar-1.2.0.tar.gz | Bin 0 -> 372 bytes tests/pkg-configure/stable/libbar-1.3.0.tar.gz | Bin 0 -> 378 bytes tests/pkg-configure/stable/libfoo-1.0.0.tar.gz | Bin 0 -> 348 bytes tests/pkg-configure/stable/libfoo-1.1.0.tar.gz | Bin 0 -> 349 bytes tests/pkg-configure/stable/libfoo-1.2.0.tar.gz | Bin 0 -> 348 bytes tests/pkg-configure/stable/repositories | 1 + tests/pkg-drop.test | 448 +++++ tests/pkg-drop/t4a | 1 + tests/pkg-drop/t4b | 1 + tests/pkg-drop/t4c | 1 + tests/pkg-drop/t4d | 1 + tests/pkg-fetch.test | 200 ++ tests/pkg-fetch/hello | 1 + tests/pkg-fetch/t1 | 1 + tests/pkg-purge.test | 182 ++ tests/pkg-purge/libfoo-1.0.0.tar.gz | 1 + tests/pkg-purge/libfoo-1.1.0 | 1 + tests/pkg-status.test | 160 ++ tests/pkg-status/extra/libbar-1.1.0+1.tar.gz | Bin 0 -> 243 bytes tests/pkg-status/extra/repositories | 3 + tests/pkg-status/stable/libbar-1.0.0.tar.gz | Bin 0 -> 241 bytes tests/pkg-status/stable/libfoo-1.0.0.tar.gz | Bin 0 -> 240 bytes tests/pkg-status/stable/repositories | 1 + tests/pkg-status/testing/libbar-1.0.0+1.tar.gz | Bin 0 -> 243 bytes tests/pkg-status/testing/libbar-1.1.0.tar.gz | Bin 0 -> 242 bytes tests/pkg-status/testing/repositories | 6 + tests/pkg-status/unstable/libbar-2.0.0.tar.gz | Bin 0 -> 245 bytes tests/pkg-status/unstable/repositories | 4 + tests/pkg-system.test | 873 +++++++++ tests/pkg-system/foo-2.tar.gz | Bin 0 -> 356 bytes tests/pkg-system/libbar-0+1.tar.gz | Bin 0 -> 239 bytes tests/pkg-system/libbar-1.tar.gz | Bin 0 -> 352 bytes tests/pkg-system/libbar-2.tar.gz | Bin 0 -> 353 bytes tests/pkg-system/libbaz-2.tar.gz | Bin 0 -> 338 bytes tests/pkg-system/t1/foo-2.tar.gz | 1 + tests/pkg-system/t1/libbar-1.tar.gz | 1 + tests/pkg-system/t1/libbar-2.tar.gz | 1 + tests/pkg-system/t1/libbaz-2.tar.gz | 1 + tests/pkg-system/t1/repositories | 1 + tests/pkg-system/t2/foo-2.tar.gz | 1 + tests/pkg-system/t2/libbar-0+1.tar.gz | 1 + tests/pkg-system/t2/repositories | 1 + tests/pkg-system/t3/foo-2.tar.gz | 1 + tests/pkg-system/t3/repositories | 3 + tests/pkg-unpack.test | 199 ++ tests/pkg-unpack/hello | 1 + tests/pkg-unpack/libfoo-1.1.0 | 1 + tests/pkg-unpack/t1 | 1 + tests/pkg-update.test | 148 ++ tests/pkg-update/hello | 1 + tests/pkg-update/libhello-1.0.0 | 1 + tests/pkg-verify.test | 59 + tests/pkg-verify/foo-1.tar.gz | 1 + tests/pkg-verify/foo-2.tar.gz | Bin 0 -> 277 bytes tests/pkg-verify/not-a-package.tar.gz | Bin 0 -> 174 bytes tests/pkg/.gitignore | 2 - .../auth/create-expired/libfoo-1.0.0.tar.gz | 1 - .../1/build2.org/auth/create-expired/repositories | 33 - .../auth/create-noemail/libfoo-1.0.0.tar.gz | 1 - .../1/build2.org/auth/create-noemail/repositories | 33 - .../1/build2.org/auth/expired/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/auth/expired/packages | 11 - tests/pkg/1/build2.org/auth/expired/repositories | 33 - tests/pkg/1/build2.org/auth/expired/signature | 13 - tests/pkg/1/build2.org/auth/libfoo-1.0.0.tar.gz | Bin 348 -> 0 bytes .../auth/name-mismatch/libfoo-1.0.0.tar.gz | 1 - .../1/build2.org/auth/name-mismatch/repositories | 34 - .../auth/sha256sum-mismatch/libfoo-1.0.0.tar.gz | 1 - .../auth/sha256sum-mismatch/repositories | 33 - .../auth/signature-mismatch/libfoo-1.0.0.tar.gz | 1 - .../auth/signature-mismatch/repositories | 33 - .../1/build2.org/auth/signed/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/auth/signed/repositories | 33 - .../build2.org/auth/unsigned1/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/auth/unsigned1/repositories | 1 - .../build2.org/auth/unsigned2/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/auth/unsigned2/repositories | 1 - .../common/bar/stable/libbar-1.0.0.tar.gz | Bin 957 -> 0 bytes .../1/build2.org/common/bar/stable/repositories | 6 - .../common/bar/testing/libbar-1.1.0.tar.gz | Bin 959 -> 0 bytes .../1/build2.org/common/bar/testing/repositories | 8 - .../common/bar/unstable/libbar-1.1.1.tar.gz | Bin 1189 -> 0 bytes .../1/build2.org/common/bar/unstable/repositories | 8 - .../common/foo/stable/libfoo-1.0.0.tar.gz | Bin 881 -> 0 bytes .../1/build2.org/common/foo/stable/repositories | 3 - .../common/foo/testing/libfoo-1.1.0.tar.gz | Bin 874 -> 0 bytes .../1/build2.org/common/foo/testing/repositories | 6 - .../build2.org/common/hello/libhello-1.0.0.tar.gz | Bin 2483 -> 0 bytes tests/pkg/1/build2.org/common/hello/repositories | 36 - .../pkg/1/build2.org/common/libhello-1.0.0/INSTALL | 1 - .../common/libhello-1.0.0/build/bootstrap.build | 22 - .../common/libhello-1.0.0/build/export.build | 6 - .../common/libhello-1.0.0/build/root.build | 6 - .../1/build2.org/common/libhello-1.0.0/buildfile | 8 - .../common/libhello-1.0.0/hello/buildfile | 21 - .../build2.org/common/libhello-1.0.0/hello/export | 36 - .../1/build2.org/common/libhello-1.0.0/hello/hello | 13 - .../common/libhello-1.0.0/hello/hello.cxx | 16 - .../1/build2.org/common/libhello-1.0.0/manifest | 14 - .../libhello-1.0.0/tests/build/bootstrap.build | 5 - .../common/libhello-1.0.0/tests/build/root.build | 14 - .../common/libhello-1.0.0/tests/buildfile | 3 - .../common/libhello-1.0.0/tests/test/buildfile | 4 - .../common/libhello-1.0.0/tests/test/driver.cxx | 11 - .../common/libhello-1.0.0/tests/test/test.out | 1 - .../pkg/1/build2.org/common/libhello-1.0.0/version | 1 - tests/pkg/1/build2.org/common/not-a-package.tar.gz | Bin 259 -> 0 bytes .../1/build2.org/depend/stable/libbar-1.0.0.tar.gz | Bin 354 -> 0 bytes .../1/build2.org/depend/stable/libbar-1.1.0.tar.gz | Bin 359 -> 0 bytes .../1/build2.org/depend/stable/libbar-1.2.0.tar.gz | Bin 372 -> 0 bytes .../1/build2.org/depend/stable/libbar-1.3.0.tar.gz | Bin 378 -> 0 bytes .../1/build2.org/depend/stable/libfoo-1.0.0.tar.gz | Bin 348 -> 0 bytes .../1/build2.org/depend/stable/libfoo-1.1.0.tar.gz | Bin 349 -> 0 bytes .../1/build2.org/depend/stable/libfoo-1.2.0.tar.gz | Bin 348 -> 0 bytes tests/pkg/1/build2.org/depend/stable/repositories | 1 - tests/pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz | Bin 348 -> 0 bytes tests/pkg/1/build2.org/fetch/libfoo-1.1.0.tar.gz | Bin 349 -> 0 bytes .../fetch/libfoo-1.1.0/build/bootstrap.build | 2 - .../pkg/1/build2.org/fetch/libfoo-1.1.0/buildfile | 1 - tests/pkg/1/build2.org/fetch/libfoo-1.1.0/manifest | 7 - tests/pkg/1/build2.org/fetch/repositories | 1 - .../pkg/1/build2.org/fetch/t1/libfoo-1.0.0.tar.gz | 1 - .../pkg/1/build2.org/fetch/t1/libfoo-1.1.0.tar.gz | 1 - tests/pkg/1/build2.org/fetch/t1/repositories | 1 - tests/pkg/1/build2.org/satisfy/libbar-1.0.0.tar.gz | Bin 356 -> 0 bytes tests/pkg/1/build2.org/satisfy/libbar-1.1.0.tar.gz | Bin 360 -> 0 bytes tests/pkg/1/build2.org/satisfy/libbar-1.2.0.tar.gz | Bin 348 -> 0 bytes tests/pkg/1/build2.org/satisfy/libbaz-1.0.0.tar.gz | Bin 359 -> 0 bytes tests/pkg/1/build2.org/satisfy/libbaz-1.1.0.tar.gz | Bin 363 -> 0 bytes tests/pkg/1/build2.org/satisfy/libbiz-1.0.0.tar.gz | Bin 366 -> 0 bytes tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz | Bin 352 -> 0 bytes tests/pkg/1/build2.org/satisfy/libfoo-1.0.0.tar.gz | Bin 348 -> 0 bytes tests/pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz | Bin 349 -> 0 bytes .../satisfy/libfoo-1.1.0/build/bootstrap.build | 2 - .../1/build2.org/satisfy/libfoo-1.1.0/buildfile | 1 - .../pkg/1/build2.org/satisfy/libfoo-1.1.0/manifest | 7 - tests/pkg/1/build2.org/satisfy/libfoo-1.2.0.tar.gz | Bin 350 -> 0 bytes tests/pkg/1/build2.org/satisfy/libfox-1.0.0.tar.gz | Bin 349 -> 0 bytes tests/pkg/1/build2.org/satisfy/repositories | 1 - .../1/build2.org/satisfy/t1/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t1/repositories | 1 - .../1/build2.org/satisfy/t2/libbar-1.0.0.tar.gz | 1 - .../1/build2.org/satisfy/t2/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t2/repositories | 1 - .../1/build2.org/satisfy/t3/libbaz-1.0.0.tar.gz | 1 - .../1/build2.org/satisfy/t3/libfox-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t3/repositories | 4 - .../1/build2.org/satisfy/t4a/libfoo-1.1.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t4a/repositories | 1 - .../1/build2.org/satisfy/t4b/libbar-1.1.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t4b/repositories | 3 - .../1/build2.org/satisfy/t4c/libbaz-1.1.0.tar.gz | 1 - .../1/build2.org/satisfy/t4c/libfoo-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t4c/repositories | 3 - .../1/build2.org/satisfy/t4d/libbiz-1.0.0.tar.gz | 1 - .../1/build2.org/satisfy/t4d/libfox-1.0.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t4d/repositories | 3 - .../1/build2.org/satisfy/t5/libbar-1.2.0.tar.gz | 1 - tests/pkg/1/build2.org/satisfy/t5/repositories | 1 - .../build2.org/status/extra/libbar-1.1.0+1.tar.gz | Bin 243 -> 0 bytes tests/pkg/1/build2.org/status/extra/repositories | 3 - .../1/build2.org/status/stable/libbar-1.0.0.tar.gz | Bin 241 -> 0 bytes .../1/build2.org/status/stable/libfoo-1.0.0.tar.gz | Bin 240 -> 0 bytes tests/pkg/1/build2.org/status/stable/repositories | 1 - .../status/testing/libbar-1.0.0+1.tar.gz | Bin 243 -> 0 bytes .../build2.org/status/testing/libbar-1.1.0.tar.gz | Bin 242 -> 0 bytes tests/pkg/1/build2.org/status/testing/repositories | 6 - .../build2.org/status/unstable/libbar-2.0.0.tar.gz | Bin 245 -> 0 bytes .../pkg/1/build2.org/status/unstable/repositories | 4 - tests/pkg/1/build2.org/system/foo-2.tar.gz | Bin 356 -> 0 bytes tests/pkg/1/build2.org/system/libbar-0+1.tar.gz | Bin 239 -> 0 bytes tests/pkg/1/build2.org/system/libbar-1.tar.gz | Bin 352 -> 0 bytes tests/pkg/1/build2.org/system/libbar-2.tar.gz | Bin 353 -> 0 bytes tests/pkg/1/build2.org/system/libbaz-2.tar.gz | Bin 338 -> 0 bytes tests/pkg/1/build2.org/system/t1/foo-2.tar.gz | 1 - tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz | 1 - tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz | 1 - tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz | 1 - tests/pkg/1/build2.org/system/t1/repositories | 1 - tests/pkg/1/build2.org/system/t2/foo-2.tar.gz | 1 - tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz | 1 - tests/pkg/1/build2.org/system/t2/repositories | 1 - tests/pkg/1/build2.org/system/t3/foo-2.tar.gz | 1 - tests/pkg/1/build2.org/system/t3/repositories | 3 - tests/pkg/publish | 17 - tests/publish | 17 + tests/remote.test | 37 + tests/rep-add.test | 70 + tests/rep-auth.test | 469 +++++ tests/rep-auth/expired/foo-1.tar.gz | 1 + tests/rep-auth/expired/packages | 11 + tests/rep-auth/expired/repositories | 33 + tests/rep-auth/expired/signature | 13 + tests/rep-auth/unsigned/foo-1.tar.gz | 1 + tests/rep-auth/unsigned/repositories | 1 + tests/rep-create.test | 184 ++ tests/rep-create/stable/foo-1.tar.gz | 1 + tests/rep-create/stable/repositories | 1 + tests/rep-create/testing/foo-2.tar.gz | Bin 0 -> 277 bytes tests/rep-create/testing/repositories | 4 + tests/rep-fetch.test | 134 ++ tests/rep-fetch/bar | 1 + tests/rep-fetch/foo | 1 + tests/rep-fetch/hello | 1 + tests/rep-info.test | 128 ++ tests/rep-info/testing/foo-1.tar.gz | 1 + tests/rep-info/testing/repositories | 6 + tests/test.sh | 2003 -------------------- 329 files changed, 5967 insertions(+), 2785 deletions(-) create mode 100644 build/export.build create mode 100644 tests/auth.test create mode 100755 tests/auth/cert create mode 100644 tests/auth/default-cert-fp create mode 100644 tests/auth/default-cert.pem create mode 100644 tests/auth/default-openssl.cnf create mode 100644 tests/auth/expired-cert.pem create mode 100644 tests/auth/key.pem create mode 100644 tests/auth/mismatch-cert.pem create mode 100644 tests/auth/mismatch-openssl.cnf create mode 100644 tests/auth/noemail-cert.pem create mode 100644 tests/auth/noemail-openssl.cnf create mode 100644 tests/build/.gitignore create mode 100644 tests/build/bootstrap.build create mode 100644 tests/build/root.build create mode 100644 tests/buildfile delete mode 100755 tests/cert.sh create mode 100644 tests/cfg-create.test create mode 100644 tests/common.test create mode 100644 tests/common/bar/stable/libbar-1.0.0.tar.gz create mode 100644 tests/common/bar/stable/repositories create mode 100644 tests/common/bar/testing/libbar-1.1.0.tar.gz create mode 100644 tests/common/bar/testing/repositories create mode 100644 tests/common/bar/unstable/libbar-1.1.1.tar.gz create mode 100644 tests/common/bar/unstable/repositories create mode 100644 tests/common/foo-1.tar.gz create mode 100644 tests/common/foo/stable/libfoo-1.0.0.tar.gz create mode 100644 tests/common/foo/stable/repositories create mode 100644 tests/common/foo/testing/libfoo-1.1.0.tar.gz create mode 100644 tests/common/foo/testing/repositories create mode 100644 tests/common/hello/libhello-1.0.0.tar.gz create mode 100644 tests/common/hello/repositories create mode 100644 tests/common/libfoo-1.1.0/build/bootstrap.build create mode 100644 tests/common/libfoo-1.1.0/buildfile create mode 100644 tests/common/libfoo-1.1.0/manifest create mode 100644 tests/common/libhello-1.0.0/INSTALL create mode 100644 tests/common/libhello-1.0.0/build/bootstrap.build create mode 100644 tests/common/libhello-1.0.0/build/export.build create mode 100644 tests/common/libhello-1.0.0/build/root.build create mode 100644 tests/common/libhello-1.0.0/buildfile create mode 100644 tests/common/libhello-1.0.0/hello/buildfile create mode 100644 tests/common/libhello-1.0.0/hello/export create mode 100644 tests/common/libhello-1.0.0/hello/hello create mode 100644 tests/common/libhello-1.0.0/hello/hello.cxx create mode 100644 tests/common/libhello-1.0.0/manifest create mode 100644 tests/common/libhello-1.0.0/tests/build/bootstrap.build create mode 100644 tests/common/libhello-1.0.0/tests/build/root.build create mode 100644 tests/common/libhello-1.0.0/tests/buildfile create mode 100644 tests/common/libhello-1.0.0/tests/test/buildfile create mode 100644 tests/common/libhello-1.0.0/tests/test/driver.cxx create mode 100644 tests/common/libhello-1.0.0/tests/test/test.out create mode 100644 tests/common/libhello-1.0.0/version create mode 100644 tests/common/satisfy/libbar-1.0.0.tar.gz create mode 100644 tests/common/satisfy/libbar-1.1.0.tar.gz create mode 100644 tests/common/satisfy/libbar-1.2.0.tar.gz create mode 100644 tests/common/satisfy/libbaz-1.0.0.tar.gz create mode 100644 tests/common/satisfy/libbaz-1.1.0.tar.gz create mode 100644 tests/common/satisfy/libbiz-1.0.0.tar.gz create mode 100644 tests/common/satisfy/libfoo-0.0.1.tar.gz create mode 100644 tests/common/satisfy/libfoo-1.0.0.tar.gz create mode 100644 tests/common/satisfy/libfoo-1.1.0.tar.gz create mode 100644 tests/common/satisfy/libfoo-1.1.0/build/bootstrap.build create mode 100644 tests/common/satisfy/libfoo-1.1.0/buildfile create mode 100644 tests/common/satisfy/libfoo-1.1.0/manifest create mode 100644 tests/common/satisfy/libfoo-1.2.0.tar.gz create mode 100644 tests/common/satisfy/libfox-1.0.0.tar.gz create mode 100644 tests/common/satisfy/repositories create mode 120000 tests/common/satisfy/t1/libfoo-1.0.0.tar.gz create mode 120000 tests/common/satisfy/t1/repositories create mode 120000 tests/common/satisfy/t2/libbar-1.0.0.tar.gz create mode 120000 tests/common/satisfy/t2/libfoo-1.0.0.tar.gz create mode 120000 tests/common/satisfy/t2/repositories create mode 120000 tests/common/satisfy/t3/libbaz-1.0.0.tar.gz create mode 120000 tests/common/satisfy/t3/libfox-1.0.0.tar.gz create mode 100644 tests/common/satisfy/t3/repositories create mode 120000 tests/common/satisfy/t4a/libfoo-1.1.0.tar.gz create mode 120000 tests/common/satisfy/t4a/repositories create mode 120000 tests/common/satisfy/t4b/libbar-1.1.0.tar.gz create mode 100644 tests/common/satisfy/t4b/repositories create mode 120000 tests/common/satisfy/t4c/libbaz-1.1.0.tar.gz create mode 120000 tests/common/satisfy/t4c/libfoo-1.0.0.tar.gz create mode 100644 tests/common/satisfy/t4c/repositories create mode 120000 tests/common/satisfy/t4d/libbiz-1.0.0.tar.gz create mode 120000 tests/common/satisfy/t4d/libfox-1.0.0.tar.gz create mode 100644 tests/common/satisfy/t4d/repositories create mode 120000 tests/common/satisfy/t5/libbar-1.2.0.tar.gz create mode 120000 tests/common/satisfy/t5/repositories create mode 100644 tests/common/t1/libfoo-1.0.0.tar.gz create mode 100644 tests/common/t1/libfoo-1.1.0.tar.gz create mode 100644 tests/common/t1/repositories create mode 100644 tests/config.test delete mode 100644 tests/default-openssl.cnf delete mode 100644 tests/key.pem delete mode 100644 tests/mismatch-openssl.cnf delete mode 100644 tests/noemail-openssl.cnf create mode 100644 tests/pkg-build.test create mode 120000 tests/pkg-build/libbar-1.0.0.tar.gz create mode 120000 tests/pkg-build/libbaz-1.1.0.tar.gz create mode 120000 tests/pkg-build/libfoo-0.0.1.tar.gz create mode 120000 tests/pkg-build/libfoo-1.0.0.tar.gz create mode 120000 tests/pkg-build/libfoo-1.1.0 create mode 120000 tests/pkg-build/libfoo-1.1.0.tar.gz create mode 120000 tests/pkg-build/libfoo-1.2.0.tar.gz create mode 120000 tests/pkg-build/t1 create mode 120000 tests/pkg-build/t2 create mode 120000 tests/pkg-build/t3 create mode 120000 tests/pkg-build/t4a create mode 120000 tests/pkg-build/t4b create mode 120000 tests/pkg-build/t4c create mode 120000 tests/pkg-build/t4d create mode 120000 tests/pkg-build/t5 create mode 100644 tests/pkg-clean.test create mode 120000 tests/pkg-clean/hello create mode 120000 tests/pkg-clean/libhello-1.0.0 create mode 100644 tests/pkg-configure.test create mode 120000 tests/pkg-configure/hello create mode 120000 tests/pkg-configure/libhello-1.0.0 create mode 100644 tests/pkg-configure/stable/libbar-1.0.0.tar.gz create mode 100644 tests/pkg-configure/stable/libbar-1.1.0.tar.gz create mode 100644 tests/pkg-configure/stable/libbar-1.2.0.tar.gz create mode 100644 tests/pkg-configure/stable/libbar-1.3.0.tar.gz create mode 100644 tests/pkg-configure/stable/libfoo-1.0.0.tar.gz create mode 100644 tests/pkg-configure/stable/libfoo-1.1.0.tar.gz create mode 100644 tests/pkg-configure/stable/libfoo-1.2.0.tar.gz create mode 100644 tests/pkg-configure/stable/repositories create mode 100644 tests/pkg-drop.test create mode 120000 tests/pkg-drop/t4a create mode 120000 tests/pkg-drop/t4b create mode 120000 tests/pkg-drop/t4c create mode 120000 tests/pkg-drop/t4d create mode 100644 tests/pkg-fetch.test create mode 120000 tests/pkg-fetch/hello create mode 120000 tests/pkg-fetch/t1 create mode 100644 tests/pkg-purge.test create mode 120000 tests/pkg-purge/libfoo-1.0.0.tar.gz create mode 120000 tests/pkg-purge/libfoo-1.1.0 create mode 100644 tests/pkg-status.test create mode 100644 tests/pkg-status/extra/libbar-1.1.0+1.tar.gz create mode 100644 tests/pkg-status/extra/repositories create mode 100644 tests/pkg-status/stable/libbar-1.0.0.tar.gz create mode 100644 tests/pkg-status/stable/libfoo-1.0.0.tar.gz create mode 100644 tests/pkg-status/stable/repositories create mode 100644 tests/pkg-status/testing/libbar-1.0.0+1.tar.gz create mode 100644 tests/pkg-status/testing/libbar-1.1.0.tar.gz create mode 100644 tests/pkg-status/testing/repositories create mode 100644 tests/pkg-status/unstable/libbar-2.0.0.tar.gz create mode 100644 tests/pkg-status/unstable/repositories create mode 100644 tests/pkg-system.test create mode 100644 tests/pkg-system/foo-2.tar.gz create mode 100644 tests/pkg-system/libbar-0+1.tar.gz create mode 100644 tests/pkg-system/libbar-1.tar.gz create mode 100644 tests/pkg-system/libbar-2.tar.gz create mode 100644 tests/pkg-system/libbaz-2.tar.gz create mode 120000 tests/pkg-system/t1/foo-2.tar.gz create mode 120000 tests/pkg-system/t1/libbar-1.tar.gz create mode 120000 tests/pkg-system/t1/libbar-2.tar.gz create mode 120000 tests/pkg-system/t1/libbaz-2.tar.gz create mode 100644 tests/pkg-system/t1/repositories create mode 120000 tests/pkg-system/t2/foo-2.tar.gz create mode 120000 tests/pkg-system/t2/libbar-0+1.tar.gz create mode 100644 tests/pkg-system/t2/repositories create mode 120000 tests/pkg-system/t3/foo-2.tar.gz create mode 100644 tests/pkg-system/t3/repositories create mode 100644 tests/pkg-unpack.test create mode 120000 tests/pkg-unpack/hello create mode 120000 tests/pkg-unpack/libfoo-1.1.0 create mode 120000 tests/pkg-unpack/t1 create mode 100644 tests/pkg-update.test create mode 120000 tests/pkg-update/hello create mode 120000 tests/pkg-update/libhello-1.0.0 create mode 100644 tests/pkg-verify.test create mode 120000 tests/pkg-verify/foo-1.tar.gz create mode 100644 tests/pkg-verify/foo-2.tar.gz create mode 100644 tests/pkg-verify/not-a-package.tar.gz delete mode 100644 tests/pkg/.gitignore delete mode 120000 tests/pkg/1/build2.org/auth/create-expired/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/create-expired/repositories delete mode 120000 tests/pkg/1/build2.org/auth/create-noemail/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/create-noemail/repositories delete mode 120000 tests/pkg/1/build2.org/auth/expired/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/expired/packages delete mode 100644 tests/pkg/1/build2.org/auth/expired/repositories delete mode 100644 tests/pkg/1/build2.org/auth/expired/signature delete mode 100644 tests/pkg/1/build2.org/auth/libfoo-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/auth/name-mismatch/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/name-mismatch/repositories delete mode 120000 tests/pkg/1/build2.org/auth/sha256sum-mismatch/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/sha256sum-mismatch/repositories delete mode 120000 tests/pkg/1/build2.org/auth/signature-mismatch/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/signature-mismatch/repositories delete mode 120000 tests/pkg/1/build2.org/auth/signed/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/signed/repositories delete mode 120000 tests/pkg/1/build2.org/auth/unsigned1/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/unsigned1/repositories delete mode 120000 tests/pkg/1/build2.org/auth/unsigned2/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/auth/unsigned2/repositories delete mode 100644 tests/pkg/1/build2.org/common/bar/stable/libbar-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/bar/stable/repositories delete mode 100644 tests/pkg/1/build2.org/common/bar/testing/libbar-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/bar/testing/repositories delete mode 100644 tests/pkg/1/build2.org/common/bar/unstable/libbar-1.1.1.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/bar/unstable/repositories delete mode 100644 tests/pkg/1/build2.org/common/foo/stable/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/foo/stable/repositories delete mode 100644 tests/pkg/1/build2.org/common/foo/testing/libfoo-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/foo/testing/repositories delete mode 100644 tests/pkg/1/build2.org/common/hello/libhello-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/common/hello/repositories delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/INSTALL delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/build/bootstrap.build delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/build/export.build delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/build/root.build delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/buildfile delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/hello/buildfile delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/hello/export delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello.cxx delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/manifest delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/bootstrap.build delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/root.build delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/buildfile delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/buildfile delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/driver.cxx delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/test.out delete mode 100644 tests/pkg/1/build2.org/common/libhello-1.0.0/version delete mode 100644 tests/pkg/1/build2.org/common/not-a-package.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libbar-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libbar-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libbar-1.2.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libbar-1.3.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libfoo-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/libfoo-1.2.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/depend/stable/repositories delete mode 100644 tests/pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/fetch/libfoo-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/fetch/libfoo-1.1.0/build/bootstrap.build delete mode 100644 tests/pkg/1/build2.org/fetch/libfoo-1.1.0/buildfile delete mode 100644 tests/pkg/1/build2.org/fetch/libfoo-1.1.0/manifest delete mode 100644 tests/pkg/1/build2.org/fetch/repositories delete mode 120000 tests/pkg/1/build2.org/fetch/t1/libfoo-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/fetch/t1/libfoo-1.1.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/fetch/t1/repositories delete mode 100644 tests/pkg/1/build2.org/satisfy/libbar-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libbar-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libbar-1.2.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libbaz-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libbaz-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libbiz-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/build/bootstrap.build delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/buildfile delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/manifest delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-1.2.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/libfox-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t1/libfoo-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t1/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t2/libbar-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t2/libfoo-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t2/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t3/libbaz-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t3/libfox-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/t3/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t4a/libfoo-1.1.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t4a/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t4b/libbar-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/t4b/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t4c/libbaz-1.1.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t4c/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/t4c/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t4d/libbiz-1.0.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t4d/libfox-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/satisfy/t4d/repositories delete mode 120000 tests/pkg/1/build2.org/satisfy/t5/libbar-1.2.0.tar.gz delete mode 120000 tests/pkg/1/build2.org/satisfy/t5/repositories delete mode 100644 tests/pkg/1/build2.org/status/extra/libbar-1.1.0+1.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/extra/repositories delete mode 100644 tests/pkg/1/build2.org/status/stable/libbar-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/stable/libfoo-1.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/stable/repositories delete mode 100644 tests/pkg/1/build2.org/status/testing/libbar-1.0.0+1.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/testing/libbar-1.1.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/testing/repositories delete mode 100644 tests/pkg/1/build2.org/status/unstable/libbar-2.0.0.tar.gz delete mode 100644 tests/pkg/1/build2.org/status/unstable/repositories delete mode 100644 tests/pkg/1/build2.org/system/foo-2.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/libbar-0+1.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/libbar-1.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/libbar-2.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/libbaz-2.tar.gz delete mode 120000 tests/pkg/1/build2.org/system/t1/foo-2.tar.gz delete mode 120000 tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz delete mode 120000 tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz delete mode 120000 tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/t1/repositories delete mode 120000 tests/pkg/1/build2.org/system/t2/foo-2.tar.gz delete mode 120000 tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/t2/repositories delete mode 120000 tests/pkg/1/build2.org/system/t3/foo-2.tar.gz delete mode 100644 tests/pkg/1/build2.org/system/t3/repositories delete mode 100755 tests/pkg/publish create mode 100755 tests/publish create mode 100644 tests/remote.test create mode 100644 tests/rep-add.test create mode 100644 tests/rep-auth.test create mode 120000 tests/rep-auth/expired/foo-1.tar.gz create mode 100644 tests/rep-auth/expired/packages create mode 100644 tests/rep-auth/expired/repositories create mode 100644 tests/rep-auth/expired/signature create mode 120000 tests/rep-auth/unsigned/foo-1.tar.gz create mode 100644 tests/rep-auth/unsigned/repositories create mode 100644 tests/rep-create.test create mode 120000 tests/rep-create/stable/foo-1.tar.gz create mode 100644 tests/rep-create/stable/repositories create mode 100644 tests/rep-create/testing/foo-2.tar.gz create mode 100644 tests/rep-create/testing/repositories create mode 100644 tests/rep-fetch.test create mode 120000 tests/rep-fetch/bar create mode 120000 tests/rep-fetch/foo create mode 120000 tests/rep-fetch/hello create mode 100644 tests/rep-info.test create mode 120000 tests/rep-info/testing/foo-1.tar.gz create mode 100644 tests/rep-info/testing/repositories delete mode 100755 tests/test.sh diff --git a/bpkg/types b/bpkg/types index 1171444..cfe2add 100644 --- a/bpkg/types +++ b/bpkg/types @@ -90,12 +90,14 @@ namespace bpkg // namespace std { - // Custom path printing (with trailing slash for directories). + // Custom path printing (canonicalized, with trailing slash for directories). // inline ostream& operator<< (ostream& os, const ::butl::path& p) { - return os << p.representation (); + string r (p.representation ()); + ::butl::path::traits::canonicalize (r); + return os << r; } } diff --git a/build/export.build b/build/export.build new file mode 100644 index 0000000..dd351d6 --- /dev/null +++ b/build/export.build @@ -0,0 +1,10 @@ +# file : build/export.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +$out_root/: +{ + include bpkg/ +} + +export $out_root/bpkg/exe{bpkg} diff --git a/buildfile b/buildfile index cb97388..7040dce 100644 --- a/buildfile +++ b/buildfile @@ -2,11 +2,10 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -d = bpkg/ doc/ +d = bpkg/ tests/ doc/ ./: $d doc{INSTALL LICENSE NEWS README version} file{manifest} -include $d # Don't install tests or the INSTALL file. # -dir{tests/}: install = false +dir{tests/}: install = false doc{INSTALL}@./: install = false diff --git a/tests/auth.test b/tests/auth.test new file mode 100644 index 0000000..3669894 --- /dev/null +++ b/tests/auth.test @@ -0,0 +1,23 @@ +# file : tests/auth.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# OpenSSL passwordless private key. +# +key = $src_base/auth/key.pem + +# Repository certificate generated with the above private key. +# +cert = $src_base/auth/default-cert.pem + +# Repository certificate fingerprint. +# ++set cert_fp <<<$src_base/auth/default-cert-fp + +# Manifest certificate name/value. Can be appended to the repositories file to +# sign the repository. +# +cert_manifest = $~/cert-manifest ++echo 'certificate: \' >=$cert_manifest ++cat <<<$cert >+$cert_manifest ++echo '\' >+$cert_manifest diff --git a/tests/auth/cert b/tests/auth/cert new file mode 100755 index 0000000..41b3b9c --- /dev/null +++ b/tests/auth/cert @@ -0,0 +1,36 @@ +#! /bin/sh + +# Normally, you don't need to regenerate the private key. +# +# openssl genrsa 4096 > key.pem + +openssl req -x509 -new -key key.pem -days 1825 -config default-openssl.cnf > \ + default-cert.pem + +cat default-cert.pem | openssl x509 -sha256 -noout -fingerprint | \ + sed -n 's/^SHA256 Fingerprint=\(.*\)$/\1/p' >default-cert-fp + +openssl req -x509 -new -key key.pem -days 1825 -config mismatch-openssl.cnf > \ + mismatch-cert.pem + +openssl req -x509 -new -key key.pem -days 1825 -config noemail-openssl.cnf > \ + noemail-cert.pem + +# Normally, you have no reason to regenerate expired-cert.pem, as need to keep +# it expired for the testing purposes. But if you do, copy expired-cert.pem +# content to the certificate value of the following manifest files: +# ../rep-auth/expired/repositories +# +# To regenerate the packages and signature manifest files run bpkg rep-create +# command, for example: +# +# ../../bpkg/bpkg rep-create ../rep-auth/expired --key key.pem +# +# We cannot do it in the testscript since the certificate has expired. This is +# also the reason why we store these auto-generated manifests in git. +# +# Will have to wait 1 day until the certificate expires. Until then testscript +# will be failing. +# +# openssl req -x509 -new -key key.pem -days 1 -config default-openssl.cnf > \ +# expired-cert.pem diff --git a/tests/auth/default-cert-fp b/tests/auth/default-cert-fp new file mode 100644 index 0000000..11ebf3a --- /dev/null +++ b/tests/auth/default-cert-fp @@ -0,0 +1 @@ +AB:0D:3F:C1:B0:13:E4:0E:AD:4A:08:06:AE:F3:85:DB:E2:27:5F:83:11:47:A2:78:64:3C:73:60:F8:66:3A:A4 diff --git a/tests/auth/default-cert.pem b/tests/auth/default-cert.pem new file mode 100644 index 0000000..34a39f9 --- /dev/null +++ b/tests/auth/default-cert.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFLzCCAxegAwIBAgIJAKroQKG400AsMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV +BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN +MTcwMzA3MDk1NjExWhcNMjIwMzA2MDk1NjExWjAzMRcwFQYDVQQKDA5Db2RlIFN5 +bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ +IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP +PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH +4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN +CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H +Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl +QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu +bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a +I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ +u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa +DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU +4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF +BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC +AgEANT2ZQXyrjo/Tqm9KWfQfbYwYMGZH8Ftm1miqpXc5/+Hs3gtKhzIgQvCByO+l +glvpqOB4sPnul1FTE/9cJFMGH6GGD/oe9pFnaR7mnz+WGwtUCa+i33QJ9sc9H8Uf +Nk8DDO1g8c6Okn2SAEvg5owygFlhdL822PTCnxB34ns1Q+mgfZlCqczh7MDtXN4h +d2ezPND6cfWTyEZ/ZYfZVJ54+xUEcuHnY6huyHQJ8vm/E0B77y1B1u9ESHCZKD0A +/Vb1CYPCIB4Re4oradVO6CkgX6+7k47vhIlFV1Ulo7KtMb1f5a7dlpiMQbVovdK2 +njsMKdaWxgQ9PWXXuDOQZ3U5BcxfUNF8wlOA9ad1Kze+i6Bp64s3FfZ4s+x3QD11 +hDofBZ0YJeEYxyY/zIz7wCmqIoM++FpSYR9lrLuVDnxWN+fdxue79C3oG86c+ny6 +/RR8P+YzO4Jy9nevMom7Hx6F+q/3vU25+NuSvupMqJB3/MuBJl9RNcQ3mcwber8l +cZNTUVoM/YQ1DwPqLmXobRNxUuqnRtaIEDoWKXNCzhFsMMFA9SJBrEaKDRAuzrxE +B7GWDvwwpnoKvTooz0g1/CJbPd7qrnAqhHzBZBe7Ux8dTJc62FKNhNn0TSZxIXhS +nqyCIjDkxJHGaTIoe32tsNxmM1JdRqJUcXHuq6vlFOfHFeI= +-----END CERTIFICATE----- diff --git a/tests/auth/default-openssl.cnf b/tests/auth/default-openssl.cnf new file mode 100644 index 0000000..c14ec06 --- /dev/null +++ b/tests/auth/default-openssl.cnf @@ -0,0 +1,22 @@ +repository = build2.org +company = Code Synthesis +email = info@build2.org + + +[ req ] + +distinguished_name = req_distinguished_name +x509_extensions = v3_req +prompt = no +utf8 = yes + +[ req_distinguished_name ] + +O = $company +CN = name:$repository + +[ v3_req ] + +keyUsage = critical,digitalSignature +extendedKeyUsage = critical,codeSigning +subjectAltName = email:$email diff --git a/tests/auth/expired-cert.pem b/tests/auth/expired-cert.pem new file mode 100644 index 0000000..3dbbe91 --- /dev/null +++ b/tests/auth/expired-cert.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFLzCCAxegAwIBAgIJAOx1KvcHxv3GMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV +BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN +MTcwMzAxMTcwMTI0WhcNMTcwMzAyMTcwMTI0WjAzMRcwFQYDVQQKDA5Db2RlIFN5 +bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ +IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP +PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH +4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN +CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H +Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl +QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu +bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a +I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ +u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa +DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU +4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF +BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC +AgEATQmuoB+NC/IF2qoNQnurJWrV63lC4Ozi/VLIqCSR6A4S9TCcoLNDAtcdiyf4 +GrM+/USyV3whpISesXn0ij10OEMe2/9NUoqkO0Q/woN9WtUQActeBxThOcz0NYMi +1vg6krlx1fKpQ5g65yC3qka8VUaV9gtaCHFa6mOxZ9q5DaV2NdBAr+FOutRY6d4v +UySkOyqxfZYLs5W2e+9ofEve17eVNFQwuJY29sw406X+18gYc+KiqldPlwKIhJs1 +CBsWhO0m1GP5dR0gRBmF9WQ4fzNyoYF293ix+WC7eMf2OtRTpo/GEAXDqLlRvpiF +jALhFtcZjiIqrvnkQFq36jyVNcUnxbMKUgW4XJVpYv4uVII47eJk4a8XRGj0d+7b +nuFfT4d6gACN3gfOmtd12uT7dNsn5q0fkGhzR4ppDIyTJpGA8UhHETTRPL+HFcb1 +6kXnRPFS7eoF9DoSGtBhdpRUefj8EPJWhfE7xQvMDTYIE/ccBWp173F+xShr2mgF +xDkHH+vXGFzUZXSEAF2NW9U3bf4bRQpdOkYJsvHJmLYjcGNKdkHjJVWdXmoRpbsR +IC8M7ZPp+/oV5JEinCXRsT1NN+7l8rkec9hNk5sbokVCcyYv+GxL8kRFt2jyLqny +RlM2vM3uhgJNYVSlYsgjjg4QfikV6s+QawjSVi6y4ZnHEho= +-----END CERTIFICATE----- diff --git a/tests/auth/key.pem b/tests/auth/key.pem new file mode 100644 index 0000000..6615a2d --- /dev/null +++ b/tests/auth/key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+IfdyjGMu +34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNPPR58SFNw +wd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH4O3aL2HB +0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXNCJ8uE8yU +cuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2HY478bHLT +2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0HlQIAGOYZz +xbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThubomWaImT +xTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6aI+yGPsWP +AhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+u7jGNUzp +9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqaDZlnVvfw +ozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU4JECAwEA +AQKCAgAz75YlpJq/l5i4XrUusSlYZxRyZNWpjwiFGspox8QwenmnXdF+XmLUwjV5 +UFuMcLwWrzHbzrUdV+5/hHCJHP8aQY3DcOJdlIchqZgdhf61i2yFG9LVJUzueGxP +mtAkc+K8ZcaSzW2BxLSjIyvr9QS+T7cHVsCQtNefvdRMU6P9A1zgDT0g+JnSt8z0 +gPnpvMpVWM67MDfn029tHHf3V+5Bs4A51sXeQpPWENnBJRkW5/zf1J6W3XQR5k3q +KGW1Yk4aATGIfN5BPwax+h70jInlALKOnprJFrnjvn47E1NnT0ceVPF6u2iaIwqX +cCEu1e3flGrrF7Ot9vilG5XL/k8q24LlPrwrjTxgNxoFtSQTHKXWir4hahPEWUJo +lbPxUaVXq0S3OsWxPbj5pAOxP5aZ/vATHsa68tQuErDif4zXhoSU1T06Tcb9pPaP +duVa0QXAy9uiK+NnFbisK7/rC+HTXz7ZdQsAm1XrwkPiLaLbaK30BS0yUNZRjUBc +gQYVShqD6CG9wo9D4HCAPulfcnJ5NqMjTOWDdoY6dAoESD/LYZntjJz5BB0hC9bH +iDIt3yrWjE8khksKvMRyHbzpOq8M6ngZWGTOwMlQ4SEbJaqYfRSK4JN7ePgIMbsE +xAIC8TAPzJNj8Fas8WG2kLTxgMdGe/LcrTL43aR+kkza6MYaVQKCAQEA7cMWLm2f +8vHr1YdBu5gaWIE1TGbZD50akRPjilBBawAXc1ho9B6HdK+l0YYXFe5jRdOWXEn0 +fOUOWR68rkW813kPyWsEGeUfaGUABIomCJIbzV21BvaNgeJIxQIhAr94lX4iVvOh +KyCkZa7NM6lYR77SrLtZgOtZjymnAN/ox78t+AyasRD2ToxoTMfgCPvbPqsCcd7i +SamIZrcGCSiz5eZaIyTgV2z8jcobSO2316LcuYCVUe47Y0Hcdmzqq7pJwym7bsiH +3nypIqVtiSvqXirst56KyAvFAfbhZFy0vx0q4PwkovLZXcdQvmKBkn5wQRIhHlFT +AWLwnxvBW2K+2wKCAQEA64M0tlMhXOW4RxwnJJVuqQJfeRj7Eg8mxJeOSaQIKW/2 +D9G1dqbxzcfzo6G+EFLB8e9qsap4KY1FWHjiqh5P4uheET9AN41YnBw2S8y5eNQn +uJdWU5B39vLfJJ/3A/IiiQ8ok+t2kyZyNpoeu90FKlNL/4mWFhRTCvG+G9ZHFkVJ +eDV7lJrErTpTX0XwHahtrOxrYMu6vj+GYFnoeMcXLsy4fb7d7CZ1qqyyEjwDkdaS +UEtb0MVatWEoBb2eCXDJnWmwwncSfgNWEicV+FNV9NLUrF4SOmeNkF0/GVMMRxZe +lBODoY99UrP6vtukkRJ8B+ObcQu0VwBoHP97zA0sAwKCAQEA3hmzCsPU+nkKuHiU +6sx3L93jD++zLGaxfnx5vaaitXVsco9P21r5ZgL+fu8neZEqovu4JZXgERtXf+C6 +mIEEmrO4D4ssVZQ29qoCjjsOtEroNbsnc820+nOLTp1igNKjreIZ6efD0im36FSV +04CJutuCqWCJh2hSTO2315VSOeVY57G+f1E9BLscYz0DBuFeOPg+XGi8MdtwU6L8 +vGmNQ2EfKl00Q/bHJRx6yHFnnsPANHjtA4/rYhkP/IBZ5vkqFmlRcXdZlHgW9wpZ +fB3N3RFz90LemWiFLASXH82J+k0g1PI0txLsAjJCNtaF+3apHd/1mACX7V+jLr4a +rWdcqQKCAQA/raI7Cg8jRxmkYIBU6/KX0ARwgcihAWfCEBhw4OE0Ewm9DT67bjhD +I6VEwR7a2wWFnO6ES0tiMMhnO4hN5xRCjgGhODDs1FL5Iserhxc/DF4RExpMTeuh +4dlj1by8XGPqGycll6zf7K1FBjb5JLGY2BzcYx8pqSUq+GImtLFT3DgZQJzBeXdk +Pzj7sbVSz4+YCfSen3dGqXZz5ttsjKhAByp7FXh7uYpnM3qSY5ezfwjgnP+eWz5D +fJmNs89fThe1cDZS3k8ps006a0cNdbrwD3Fhia30DLvCJPRCrKnNLscz0nLs5BdG +nVNW95xvfUf7+ha1YizIuVttO8cFTSpxAoIBAET0kO0jKwSYzBBJBMWHlAmYfaiW +WUUYAYpk2jHaK8L4QSNZOvBIEovMCdNN9+D8yQ09HGMxny5+MkSF9CaRRdC1MFfg +bZVlmC+UlzeuMEHalrYVWmIQ29KsF7vo9dKBz1BHMQ77D4lzaV1fZ9EPg+XbbNG2 +6N/rC8ubuC4CjnqMCO0tFM+Gq6ixzDmBkzEWYStEwMQVIkfJ/BxVFHyH8DsRDmvO +1u3lZ7Ks0HyiSOe45q/E6PnNV+oV6f1EeZESZysuD96fHm8XMC6iBwK0AQ0hUZ4e +cVzIsHBEMzLJx6On7xQYR7FNmdW+8fJmMXyniCUS9c26upTNwWVDX+U4Y4M= +-----END RSA PRIVATE KEY----- diff --git a/tests/auth/mismatch-cert.pem b/tests/auth/mismatch-cert.pem new file mode 100644 index 0000000..785e094 --- /dev/null +++ b/tests/auth/mismatch-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFTzCCAzegAwIBAgIJAO7DtVrDDUcXMA0GCSqGSIb3DQEBCwUAMEMxFzAVBgNV +BAoMDkNvZGUgU3ludGhlc2lzMSgwJgYDVQQDDB9uYW1lOmJ1aWxkMi5vcmcvbWlz +bWF0Y2hlZC9uYW1lMB4XDTE3MDMwNzA5NTYxMVoXDTIyMDMwNjA5NTYxMVowQzEX +MBUGA1UECgwOQ29kZSBTeW50aGVzaXMxKDAmBgNVBAMMH25hbWU6YnVpbGQyLm9y +Zy9taXNtYXRjaGVkL25hbWUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDau/El7sxcwjKBVNUZ8xHgH8xNFFGBsp0txdpRu74h93KMYy7fgaxQbnVbOFw0 +6Y10tfYUcSKIRIA+9VtY4Q75lAvcgjFtdzwiCI0Sk089HnxIU3DB3YToLymbI3tC +Fe7L6ClV3Buw31FZedcFj0D0m1K37EG7F4Oz8+R2g8fg7dovYcHRNTNM+EdnbcEJ +LMxcgiol/ERfaD14q08+REywt39fSVGqS62OZeWcpc0Iny4TzJRy5a09J+ypKIR+ +8Gl9ysni2tDNiCJd82ngLLjfhKxVXnAHZSSL19NHLYdjjvxsctPbCCpWoItqu2Q4 +pNrDLxvHQL+4DWbF6fhTo/11wojiPX+g+aLKSXSvQeVAgAY5hnPFuTnb+mS3suVI +u+pbiO3IiEzinwKBJG8jIjR4kcS3TO2gHos3XMB1OG5uiZZoiZPFMslfOX995rwk +n7qOw/g0GIiuudP8cEXUxQSKot/CMDBOtoE+2ofwDpoj7IY+xY8CFO2Vh7JMq/aq +RMUDhCiV6C2SaNa3+jEXPALCcs+s3X0IU9QU84aIDX67uMY1TOn0q40VBd+JrLln +M/xyqPVt+dAMNsuRefZM4j/puxurgWK6phJb/9d1WpoNmWdW9/CjM+UrN0pH3AxK +zs8/w/tIUZTmgiHlrbNRts1nELwZ5/sxgPrEyLtMQBTgkQIDAQABo0YwRDAOBgNV +HQ8BAf8EBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwMwGgYDVR0RBBMwEYEP +aW5mb0BidWlsZDIub3JnMA0GCSqGSIb3DQEBCwUAA4ICAQDCecjF6hzS8IcSsOgx +ReZIu4UPpBXGcfvx5NSiYqahxeepWTnd6Du14Z5gtQZYeXsNLnhHaZMNgLKPnQ0g +cmpTpeqQF9XKiWbW7YQVstwWdPWoWmmqfZY1nz5jPD/aYBzq+JV1UjztWTQgCQYu +bovxs/kor6BcPy+KH5oKGq6l+kDdaXCKNqHP7Eg0xiB7tjP8OFt4XPV34tLcLQcb +gZdhuDCNgds0n8EglUoUBieRtDVIWxP2uVfiTiVTEVpFeFjC2KWEZ5OtFXa4WTkY +CLDnxVAngZ2xmfNt189YGUrtDS1kD/Kza+wOggQ95iHy2zyNlU4cHZVJxakOm3yf +X7EcLoQLY2rwtQUr+h+qvk/zrN5eBB50zjTrbFaIC+zTR4FOv+/UWieX8k/aqcnD +DeLvcEjuh+amLSapYlYrhMGal615PIbsi3eAJJz5ZDS8oUuev9NcuU57rBNqUNbz +UV8hMHGsD7ej8Tu+XeEgIBmBY6Bke1M6VU00Bt3xW0bH9yaEa0RWSflyfQfX4WGA +Ukl/CzI3IVxqO8TXDJ5ww0NOdzl9PkQV5HwzDiukutkrvGumUDzu5zkvSyDPGauO +/xmojCNSGuGYAI1bQnJjLtnKOxJgrHxTsiNCznOCXePr9+/UcoIQ6nyrHwi37/ze +8hMr+XqSi4IaPRAjSsj8b6IVVg== +-----END CERTIFICATE----- diff --git a/tests/auth/mismatch-openssl.cnf b/tests/auth/mismatch-openssl.cnf new file mode 100644 index 0000000..0c328d0 --- /dev/null +++ b/tests/auth/mismatch-openssl.cnf @@ -0,0 +1,22 @@ +repository = build2.org/mismatched/name +company = Code Synthesis +email = info@build2.org + + +[ req ] + +distinguished_name = req_distinguished_name +x509_extensions = v3_req +prompt = no +utf8 = yes + +[ req_distinguished_name ] + +O = $company +CN = name:$repository + +[ v3_req ] + +keyUsage = critical,digitalSignature +extendedKeyUsage = critical,codeSigning +subjectAltName = email:$email diff --git a/tests/auth/noemail-cert.pem b/tests/auth/noemail-cert.pem new file mode 100644 index 0000000..420c195 --- /dev/null +++ b/tests/auth/noemail-cert.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFEzCCAvugAwIBAgIJALnZEjzzFueMMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV +BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN +MTcwMzA3MDk1NjExWhcNMjIwMzA2MDk1NjExWjAzMRcwFQYDVQQKDA5Db2RlIFN5 +bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ +IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP +PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH +4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN +CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H +Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl +QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu +bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a +I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ +u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa +DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU +4JECAwEAAaMqMCgwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF +BwMDMA0GCSqGSIb3DQEBCwUAA4ICAQC1grbRMNAvDJ2+yYnHsGsafgx7mYM7QN7N +kHyYdzr87wvumRiJ5xgnn49VBO51RQkcT7Z/P4MJq9xjYkKS+wCJV2+WTev3ltzQ +LyFfRJkTJKTvHRDM+hbRFqyvtuRe4U91/aJU7G79gaCjmEr2LSwOywusnPU95VNw +UPMUMUYhdD1qdQfJ+PbNmrl1UC8MaflwVOb7K/OSjl7tO9JOk3QK3cMm9bqpeCYD +3HJglvl/yLzW3smh6DxdBVujWcrOAbTALc1tC2bTNQm+f83MipD4YXj09qWAnBy0 +WdRuEtdwZKW3zQ/Y1QesZcEv/3QBYSaKkwr+9sNqAHpD/UVj7qwRfHYLs1GM6o+d +/bpYz+evSdEu/3lMDxg4CLQtRqElgOnOhvIuziu7qcpgmJpRvYSHJ7RrGQET/fna ++a5KZiYvWVbFQhA79nPBGWvW/Om2dk+/pzn40zcnwnRF8wwNt8ncAI/ZhjLap5qG +5VFoMA/AP+MCsk0at3E4t4VwofdS7WB0KJv2cuGEnLRk7GOP058zOv/QQt2fXgK/ +iO68nn7vfNzVFNfbb6vYzfKigd9JiYn+icfi/cZfB7zbVHzvjS3GEQk+2NVBnnyf +LUTr5k9fTekFR1l1AE8NWi56fJ6W5d/TApkl8uun7CItHL6y2WuLyKhMxAp66LLB +hMfgR3OW4w== +-----END CERTIFICATE----- diff --git a/tests/auth/noemail-openssl.cnf b/tests/auth/noemail-openssl.cnf new file mode 100644 index 0000000..4fc8618 --- /dev/null +++ b/tests/auth/noemail-openssl.cnf @@ -0,0 +1,20 @@ +repository = build2.org +company = Code Synthesis + + +[ req ] + +distinguished_name = req_distinguished_name +x509_extensions = v3_req +prompt = no +utf8 = yes + +[ req_distinguished_name ] + +O = $company +CN = name:$repository + +[ v3_req ] + +keyUsage = critical,digitalSignature +extendedKeyUsage = critical,codeSigning diff --git a/tests/build/.gitignore b/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build new file mode 100644 index 0000000..355a05a --- /dev/null +++ b/tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : tests/build/bootstrap.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/tests/build/root.build b/tests/build/root.build new file mode 100644 index 0000000..c188bc6 --- /dev/null +++ b/tests/build/root.build @@ -0,0 +1,17 @@ +# file : tests/build/root.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# We need to configure C++ module to pass the compiler path to some of bpkg +# test commands. +# +using cxx + +# Setup the bpkg that we are testing. +# +import bpkg = bpkg%exe{bpkg} +dir{*}: test = $bpkg + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/tests/buildfile b/tests/buildfile new file mode 100644 index 0000000..d59d40e --- /dev/null +++ b/tests/buildfile @@ -0,0 +1,12 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +define common: file +common{*}: extension = test + +# The common/ directory contains repositories that are reused, being symlinked +# in source repositories specific for testscripts. +# +./: test{* -common -config -auth -remote} common{common config auth remote} \ + {*/ -build/ -test/}{**} $bpkg diff --git a/tests/cert.sh b/tests/cert.sh deleted file mode 100755 index 7382636..0000000 --- a/tests/cert.sh +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh - -# Normally, you don't need to regenerate the private key. -# -# openssl genrsa 4096 > key.pem - -# Copy default-cert.pem content to the certificate value of the following -# manifest files: -# pkg/1/build2.org/auth/signature-mismatch/repositories -# pkg/1/build2.org/auth/sha256sum-mismatch/repositories -# pkg/1/build2.org/auth/signed/repositories -# pkg/1/build2.org/common/hello/repositories -# -openssl req -x509 -new -key key.pem -days 365 -config default-openssl.cnf > \ - default-cert.pem - -# Copy mismatch-cert.pem content to the certificate value of -# pkg/1/build2.org/auth/name-mismatch/repositories manifest file. -# -openssl req -x509 -new -key key.pem -days 365 -config mismatch-openssl.cnf > \ - mismatch-cert.pem - -# Copy noemail-cert.pem content to the certificate value of -# pkg/1/build2.org/auth/create-noemail/repositories manifest file. -# -openssl req -x509 -new -key key.pem -days 365 -config noemail-openssl.cnf > \ - noemail-cert.pem - -# Normally, you have no reason to regenerate expired-cert.pem, as need to keep -# it expired for the testing purposes. But if you do, copy expired-cert.pem -# content to the certificate value of the following manifest files: -# pkg/1/build2.org/auth/expired/repositories -# pkg/1/build2.org/auth/create-expired/repositories -# -# To regenerate the packages and signature manifest files run: -# -# ../bpkg/bpkg rep-create pkg/1/build2.org/auth/expired --key key.pem -# -# We cannot do it in test.sh since the certificate has expired. This is also -# the reason why we store these auto-generated manifests in git. -# -# Will have to wait 1 day until the certificate expires. Until then test.sh -# will be failing. -# -# openssl req -x509 -new -key key.pem -days 1 -config default-openssl.cnf > \ -# expired-cert.pem diff --git a/tests/cfg-create.test b/tests/cfg-create.test new file mode 100644 index 0000000..65fe2f9 --- /dev/null +++ b/tests/cfg-create.test @@ -0,0 +1,75 @@ +# file : tests/cfg-create.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test + +pkg_status += -d cfg + +: non-empty +: +$* 2>>/~%EOE% != 0 +error: directory ./ is not empty + info: use --wipe to clean it up but be careful +EOE + +: dir +: +{ + test.arguments += -d cfg + test.cleanups += &cfg/*** + + : no-vars-mods + : + { + $* 2>>/~%EOE%; + %created new configuration in .+/cfg/% + EOE + + $pkg_status libfoo >'unknown' + } + + : conf-var + : + { + $* "config.install.root=$~/opt" 2>>/~%EOE%; + %created new configuration in .+/cfg/% + EOE + + $pkg_status libfoo >'unknown'; + + cat cfg/build/config.build >>/~"%EOO%" + %.+ + %config.install.root = '?.+/opt/'?% + %.+ + EOO + } + + : module + : + { + $* cxx "config.cxx=$config.cxx" 2>>/~%EOE%; + %created new configuration in .+/cfg/% + EOE + + $pkg_status libfoo >'unknown'; + + cat cfg/build/config.build >>/~"%EOO%" + %.+ + %config.cxx = .+% + %.+ + EOO + } + + : wipe + : + { + mkdir -p cfg/foo/bar &!cfg/ &!cfg/foo/ &!cfg/foo/bar/; + + $* --wipe 2>>/~%EOE%; + %created new configuration in .+/cfg/% + EOE + + $pkg_status libfoo >'unknown' + } +} diff --git a/tests/common.test b/tests/common.test new file mode 100644 index 0000000..8fec47e --- /dev/null +++ b/tests/common.test @@ -0,0 +1,41 @@ +# file : tests/common.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Commonly-used variables setup and driver command line. +# + +# All testscripts are named after bpkg commands, for example pkg-verify.test. +# So the testscript scope id is a name of the command being tested. +# +cmd = [string] $@ +test.arguments = $cmd + +# Each testscript has an associated repository source directory. Its +# subdirectories are copied by tests to manipulate locally and throw away upon +# completion. +# +src = [dir_path] "$src_base/$@" + +# Helper commands that can be used by tests to prepare the testing environment +# or validate an outcome of the command being tested. They are likely to get +# additional options and redirects appended prior to use. A common approach +# will be to redirect output to the null device for commands that are used for +# test setup, and to match it for commands being tested or performing teardown +# (for example, to make sure that configuration post-test state is valid and is +# as expected). +# +cfg_create = $0 cfg-create +pkg_build = $0 pkg-build +pkg_configure = $0 pkg-configure +pkg_disfigure = $0 pkg-disfigure +pkg_drop = $0 pkg-drop +pkg_fetch = $0 pkg-fetch +pkg_purge = $0 pkg-purge +pkg_status = $0 pkg-status +pkg_unpack = $0 pkg-unpack +pkg_update = $0 pkg-update +rep_add = $0 rep-add +rep_create = $0 rep-create +rep_fetch = $0 rep-fetch +rep_info = $0 rep-info diff --git a/tests/common/bar/stable/libbar-1.0.0.tar.gz b/tests/common/bar/stable/libbar-1.0.0.tar.gz new file mode 100644 index 0000000..d77c1ba Binary files /dev/null and b/tests/common/bar/stable/libbar-1.0.0.tar.gz differ diff --git a/tests/common/bar/stable/repositories b/tests/common/bar/stable/repositories new file mode 100644 index 0000000..b8ecc1f --- /dev/null +++ b/tests/common/bar/stable/repositories @@ -0,0 +1,6 @@ +# bar/stable +# +: 1 +location: ../../foo/stable +: + diff --git a/tests/common/bar/testing/libbar-1.1.0.tar.gz b/tests/common/bar/testing/libbar-1.1.0.tar.gz new file mode 100644 index 0000000..f081804 Binary files /dev/null and b/tests/common/bar/testing/libbar-1.1.0.tar.gz differ diff --git a/tests/common/bar/testing/repositories b/tests/common/bar/testing/repositories new file mode 100644 index 0000000..5ab8cba --- /dev/null +++ b/tests/common/bar/testing/repositories @@ -0,0 +1,8 @@ +# bar/testing +# +: 1 +location: ../../foo/testing +: +location: ../stable +role: complement +: diff --git a/tests/common/bar/unstable/libbar-1.1.1.tar.gz b/tests/common/bar/unstable/libbar-1.1.1.tar.gz new file mode 100644 index 0000000..a0fbdc3 Binary files /dev/null and b/tests/common/bar/unstable/libbar-1.1.1.tar.gz differ diff --git a/tests/common/bar/unstable/repositories b/tests/common/bar/unstable/repositories new file mode 100644 index 0000000..d4ddcf5 --- /dev/null +++ b/tests/common/bar/unstable/repositories @@ -0,0 +1,8 @@ +# bar/unstable +# +: 1 +location: ../../foo/testing +: +location: ../testing +role: complement +: diff --git a/tests/common/foo-1.tar.gz b/tests/common/foo-1.tar.gz new file mode 100644 index 0000000..0195f04 Binary files /dev/null and b/tests/common/foo-1.tar.gz differ diff --git a/tests/common/foo/stable/libfoo-1.0.0.tar.gz b/tests/common/foo/stable/libfoo-1.0.0.tar.gz new file mode 100644 index 0000000..c29dd9d Binary files /dev/null and b/tests/common/foo/stable/libfoo-1.0.0.tar.gz differ diff --git a/tests/common/foo/stable/repositories b/tests/common/foo/stable/repositories new file mode 100644 index 0000000..13673fb --- /dev/null +++ b/tests/common/foo/stable/repositories @@ -0,0 +1,3 @@ +# foo/stable +# +: 1 diff --git a/tests/common/foo/testing/libfoo-1.1.0.tar.gz b/tests/common/foo/testing/libfoo-1.1.0.tar.gz new file mode 100644 index 0000000..a6c0202 Binary files /dev/null and b/tests/common/foo/testing/libfoo-1.1.0.tar.gz differ diff --git a/tests/common/foo/testing/repositories b/tests/common/foo/testing/repositories new file mode 100644 index 0000000..cd33f88 --- /dev/null +++ b/tests/common/foo/testing/repositories @@ -0,0 +1,6 @@ +# foo/testing +# +: 1 +location: ../stable +role: complement +: diff --git a/tests/common/hello/libhello-1.0.0.tar.gz b/tests/common/hello/libhello-1.0.0.tar.gz new file mode 100644 index 0000000..e9d9ff1 Binary files /dev/null and b/tests/common/hello/libhello-1.0.0.tar.gz differ diff --git a/tests/common/hello/repositories b/tests/common/hello/repositories new file mode 100644 index 0000000..eb30fe1 --- /dev/null +++ b/tests/common/hello/repositories @@ -0,0 +1,4 @@ +# Hello World repository. Currently does not have any prerequisite +# repositories. +# +: 1 diff --git a/tests/common/libfoo-1.1.0/build/bootstrap.build b/tests/common/libfoo-1.1.0/build/bootstrap.build new file mode 100644 index 0000000..54f267e --- /dev/null +++ b/tests/common/libfoo-1.1.0/build/bootstrap.build @@ -0,0 +1,2 @@ +project = fetch-libfoo +using config diff --git a/tests/common/libfoo-1.1.0/buildfile b/tests/common/libfoo-1.1.0/buildfile new file mode 100644 index 0000000..9f80de9 --- /dev/null +++ b/tests/common/libfoo-1.1.0/buildfile @@ -0,0 +1 @@ +./: diff --git a/tests/common/libfoo-1.1.0/manifest b/tests/common/libfoo-1.1.0/manifest new file mode 100644 index 0000000..3453757 --- /dev/null +++ b/tests/common/libfoo-1.1.0/manifest @@ -0,0 +1,7 @@ +: 1 +name: libfoo +version: 1.1.0 +summary: libfoo +license: MIT +url: http://example.org +email: pkg@example.org diff --git a/tests/common/libhello-1.0.0/INSTALL b/tests/common/libhello-1.0.0/INSTALL new file mode 100644 index 0000000..485b10f --- /dev/null +++ b/tests/common/libhello-1.0.0/INSTALL @@ -0,0 +1 @@ +Just use build2, bro. diff --git a/tests/common/libhello-1.0.0/build/bootstrap.build b/tests/common/libhello-1.0.0/build/bootstrap.build new file mode 100644 index 0000000..8d8db2b --- /dev/null +++ b/tests/common/libhello-1.0.0/build/bootstrap.build @@ -0,0 +1,22 @@ +project = libhello + +using build@0.4.0-a1 + +version = 1.0.0 + +abi_major = 1 +abi_minor = 0 +abi_patch = 0 +abi_prerelease = false + +revision = 0 + +dist.package = $project-$version + +if ($revision != 0) + dist.package += +$revision + +using config +using dist +using test +using install diff --git a/tests/common/libhello-1.0.0/build/export.build b/tests/common/libhello-1.0.0/build/export.build new file mode 100644 index 0000000..1eb73b7 --- /dev/null +++ b/tests/common/libhello-1.0.0/build/export.build @@ -0,0 +1,6 @@ +$out_root/: +{ + include hello/ +} + +export $out_root/hello/lib{hello} diff --git a/tests/common/libhello-1.0.0/build/root.build b/tests/common/libhello-1.0.0/build/root.build new file mode 100644 index 0000000..4f70114 --- /dev/null +++ b/tests/common/libhello-1.0.0/build/root.build @@ -0,0 +1,6 @@ +cxx.std = 11 + +using cxx + +hxx{*}: extension = +cxx{*}: extension = cxx diff --git a/tests/common/libhello-1.0.0/buildfile b/tests/common/libhello-1.0.0/buildfile new file mode 100644 index 0000000..a416648 --- /dev/null +++ b/tests/common/libhello-1.0.0/buildfile @@ -0,0 +1,8 @@ +d = hello/ tests/ +./: $d doc{INSTALL version} file{manifest} +include $d + +# Don't install tests or the INSTALL file. +# +dir{tests/}: install = false +doc{INSTALL}@./: install = false diff --git a/tests/common/libhello-1.0.0/hello/buildfile b/tests/common/libhello-1.0.0/hello/buildfile new file mode 100644 index 0000000..bff7fce --- /dev/null +++ b/tests/common/libhello-1.0.0/hello/buildfile @@ -0,0 +1,21 @@ +lib{hello}: {hxx cxx}{hello} hxx{export} + +# For pre-releases use the complete version to make sure they cannot be used +# in place of another pre-release or the final version. +# +if $abi_prerelease + lib{hello}: bin.lib.version = @-$version +else + lib{hello}: bin.lib.version = @-$abi_major.$abi_minor + +cxx.poptions += "-I$src_root" +obja{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD +objs{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD + +lib{hello}: cxx.export.poptions = "-I$src_root" +liba{hello}: cxx.export.poptions += -DLIBHELLO_STATIC +libs{hello}: cxx.export.poptions += -DLIBHELLO_SHARED + +# Install into the hello/ subdirectory of, say, /usr/include/. +# +install.include = $install.include/hello/ diff --git a/tests/common/libhello-1.0.0/hello/export b/tests/common/libhello-1.0.0/hello/export new file mode 100644 index 0000000..18f4968 --- /dev/null +++ b/tests/common/libhello-1.0.0/hello/export @@ -0,0 +1,36 @@ +// file: hello/export -*- C++ -*- + +#pragma once + +// Normally we don't export class templates (but do complete specializations), +// inline functions, and classes with only inline member functions. Exporting +// classes that inherit from non-exported/imported bases (e.g., std::string) +// will end up badly. The only known workarounds are to not inherit or to not +// export. Also, MinGW GCC doesn't like seeing non-exported function being +// used before their inline definition. The workaround is to reorder code. In +// the end it's all trial and error. + +#if defined(LIBHELLO_STATIC) // Using static. +# define LIBHELLO_EXPORT +#elif defined(LIBHELLO_STATIC_BUILD) // Building static. +# define LIBHELLO_EXPORT +#elif defined(LIBHELLO_SHARED) // Using shared. +# ifdef _WIN32 +# define LIBHELLO_EXPORT __declspec(dllimport) +# else +# define LIBHELLO_EXPORT +# endif +#elif defined(LIBHELLO_SHARED_BUILD) // Building shared. +# ifdef _WIN32 +# define LIBHELLO_EXPORT __declspec(dllexport) +# else +# define LIBHELLO_EXPORT +# endif +#else +// If none of the above macros are defined, then we assume we are being used +// by some third-party build system that cannot/doesn't signal the library +// type. Note that this fallback works for both static and shared but in case +// of shared will be sub-optimal compared to having dllimport. +// +# define LIBHELLO_EXPORT // Using static or shared. +#endif diff --git a/tests/common/libhello-1.0.0/hello/hello b/tests/common/libhello-1.0.0/hello/hello new file mode 100644 index 0000000..5fb7d9e --- /dev/null +++ b/tests/common/libhello-1.0.0/hello/hello @@ -0,0 +1,13 @@ +// file: hello/hello -*- C++ -*- + +#pragma once + +#include + +#include + +namespace hello +{ + LIBHELLO_EXPORT void + say (const std::string& name); +} diff --git a/tests/common/libhello-1.0.0/hello/hello.cxx b/tests/common/libhello-1.0.0/hello/hello.cxx new file mode 100644 index 0000000..65d0aa7 --- /dev/null +++ b/tests/common/libhello-1.0.0/hello/hello.cxx @@ -0,0 +1,16 @@ +// file: hello/hello.cxx -*- C++ -*- + +#include + +#include + +using namespace std; + +namespace hello +{ + void + say (const string& n) + { + cout << "Hello, " << n << '!' << endl; + } +} diff --git a/tests/common/libhello-1.0.0/manifest b/tests/common/libhello-1.0.0/manifest new file mode 100644 index 0000000..75dc91b --- /dev/null +++ b/tests/common/libhello-1.0.0/manifest @@ -0,0 +1,14 @@ +: 1 +name: libhello +version: 1.0.0 +summary: The "Hello World" example library +license: MIT +tags: c++, hello, world, example +description: \ +A simple library that implements the "Hello World" example in C++. Its primary +goal is to show a canonical build2/bpkg project/package. +\ +url: http://www.example.org/libhello +email: hello-users@example.org +requires: c++11 +requires: build2 >= 0.4.0 diff --git a/tests/common/libhello-1.0.0/tests/build/bootstrap.build b/tests/common/libhello-1.0.0/tests/build/bootstrap.build new file mode 100644 index 0000000..2c2de24 --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/build/bootstrap.build @@ -0,0 +1,5 @@ +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/tests/common/libhello-1.0.0/tests/build/root.build b/tests/common/libhello-1.0.0/tests/build/root.build new file mode 100644 index 0000000..de723b8 --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/build/root.build @@ -0,0 +1,14 @@ +cxx.std = 11 + +using cxx + +hxx{*}: extension = +cxx{*}: extension = cxx + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/tests/common/libhello-1.0.0/tests/buildfile b/tests/common/libhello-1.0.0/tests/buildfile new file mode 100644 index 0000000..4dcbe2a --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/buildfile @@ -0,0 +1,3 @@ +d = test/ +./: $d +include $d diff --git a/tests/common/libhello-1.0.0/tests/test/buildfile b/tests/common/libhello-1.0.0/tests/test/buildfile new file mode 100644 index 0000000..a46969d --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/test/buildfile @@ -0,0 +1,4 @@ +import libs = libhello%lib{hello} + +exe{driver}: cxx{driver} $libs +exe{driver}: test.output = test.out diff --git a/tests/common/libhello-1.0.0/tests/test/driver.cxx b/tests/common/libhello-1.0.0/tests/test/driver.cxx new file mode 100644 index 0000000..59bfb2d --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/test/driver.cxx @@ -0,0 +1,11 @@ +// file: tests/test/driver.cxx -*- C++ -*- + +#include + +int +main () +{ + using hello::say; + + say ("World"); +} diff --git a/tests/common/libhello-1.0.0/tests/test/test.out b/tests/common/libhello-1.0.0/tests/test/test.out new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/tests/common/libhello-1.0.0/tests/test/test.out @@ -0,0 +1 @@ +Hello, World! diff --git a/tests/common/libhello-1.0.0/version b/tests/common/libhello-1.0.0/version new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/tests/common/libhello-1.0.0/version @@ -0,0 +1 @@ +1.0.0 diff --git a/tests/common/satisfy/libbar-1.0.0.tar.gz b/tests/common/satisfy/libbar-1.0.0.tar.gz new file mode 100644 index 0000000..5dc3a9b Binary files /dev/null and b/tests/common/satisfy/libbar-1.0.0.tar.gz differ diff --git a/tests/common/satisfy/libbar-1.1.0.tar.gz b/tests/common/satisfy/libbar-1.1.0.tar.gz new file mode 100644 index 0000000..881292e Binary files /dev/null and b/tests/common/satisfy/libbar-1.1.0.tar.gz differ diff --git a/tests/common/satisfy/libbar-1.2.0.tar.gz b/tests/common/satisfy/libbar-1.2.0.tar.gz new file mode 100644 index 0000000..4572395 Binary files /dev/null and b/tests/common/satisfy/libbar-1.2.0.tar.gz differ diff --git a/tests/common/satisfy/libbaz-1.0.0.tar.gz b/tests/common/satisfy/libbaz-1.0.0.tar.gz new file mode 100644 index 0000000..1de32b2 Binary files /dev/null and b/tests/common/satisfy/libbaz-1.0.0.tar.gz differ diff --git a/tests/common/satisfy/libbaz-1.1.0.tar.gz b/tests/common/satisfy/libbaz-1.1.0.tar.gz new file mode 100644 index 0000000..1aa72a8 Binary files /dev/null and b/tests/common/satisfy/libbaz-1.1.0.tar.gz differ diff --git a/tests/common/satisfy/libbiz-1.0.0.tar.gz b/tests/common/satisfy/libbiz-1.0.0.tar.gz new file mode 100644 index 0000000..42e3db4 Binary files /dev/null and b/tests/common/satisfy/libbiz-1.0.0.tar.gz differ diff --git a/tests/common/satisfy/libfoo-0.0.1.tar.gz b/tests/common/satisfy/libfoo-0.0.1.tar.gz new file mode 100644 index 0000000..2ab5094 Binary files /dev/null and b/tests/common/satisfy/libfoo-0.0.1.tar.gz differ diff --git a/tests/common/satisfy/libfoo-1.0.0.tar.gz b/tests/common/satisfy/libfoo-1.0.0.tar.gz new file mode 100644 index 0000000..28a6a90 Binary files /dev/null and b/tests/common/satisfy/libfoo-1.0.0.tar.gz differ diff --git a/tests/common/satisfy/libfoo-1.1.0.tar.gz b/tests/common/satisfy/libfoo-1.1.0.tar.gz new file mode 100644 index 0000000..e03481f Binary files /dev/null and b/tests/common/satisfy/libfoo-1.1.0.tar.gz differ diff --git a/tests/common/satisfy/libfoo-1.1.0/build/bootstrap.build b/tests/common/satisfy/libfoo-1.1.0/build/bootstrap.build new file mode 100644 index 0000000..b24ee6a --- /dev/null +++ b/tests/common/satisfy/libfoo-1.1.0/build/bootstrap.build @@ -0,0 +1,2 @@ +project = satisfy-libfoo +using config diff --git a/tests/common/satisfy/libfoo-1.1.0/buildfile b/tests/common/satisfy/libfoo-1.1.0/buildfile new file mode 100644 index 0000000..9f80de9 --- /dev/null +++ b/tests/common/satisfy/libfoo-1.1.0/buildfile @@ -0,0 +1 @@ +./: diff --git a/tests/common/satisfy/libfoo-1.1.0/manifest b/tests/common/satisfy/libfoo-1.1.0/manifest new file mode 100644 index 0000000..3453757 --- /dev/null +++ b/tests/common/satisfy/libfoo-1.1.0/manifest @@ -0,0 +1,7 @@ +: 1 +name: libfoo +version: 1.1.0 +summary: libfoo +license: MIT +url: http://example.org +email: pkg@example.org diff --git a/tests/common/satisfy/libfoo-1.2.0.tar.gz b/tests/common/satisfy/libfoo-1.2.0.tar.gz new file mode 100644 index 0000000..80ce03b Binary files /dev/null and b/tests/common/satisfy/libfoo-1.2.0.tar.gz differ diff --git a/tests/common/satisfy/libfox-1.0.0.tar.gz b/tests/common/satisfy/libfox-1.0.0.tar.gz new file mode 100644 index 0000000..9ba7a31 Binary files /dev/null and b/tests/common/satisfy/libfox-1.0.0.tar.gz differ diff --git a/tests/common/satisfy/repositories b/tests/common/satisfy/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/common/satisfy/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/common/satisfy/t1/libfoo-1.0.0.tar.gz b/tests/common/satisfy/t1/libfoo-1.0.0.tar.gz new file mode 120000 index 0000000..32e5a3c --- /dev/null +++ b/tests/common/satisfy/t1/libfoo-1.0.0.tar.gz @@ -0,0 +1 @@ +../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t1/repositories b/tests/common/satisfy/t1/repositories new file mode 120000 index 0000000..d965b15 --- /dev/null +++ b/tests/common/satisfy/t1/repositories @@ -0,0 +1 @@ +../repositories \ No newline at end of file diff --git a/tests/common/satisfy/t2/libbar-1.0.0.tar.gz b/tests/common/satisfy/t2/libbar-1.0.0.tar.gz new file mode 120000 index 0000000..93e8c71 --- /dev/null +++ b/tests/common/satisfy/t2/libbar-1.0.0.tar.gz @@ -0,0 +1 @@ +../libbar-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t2/libfoo-1.0.0.tar.gz b/tests/common/satisfy/t2/libfoo-1.0.0.tar.gz new file mode 120000 index 0000000..32e5a3c --- /dev/null +++ b/tests/common/satisfy/t2/libfoo-1.0.0.tar.gz @@ -0,0 +1 @@ +../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t2/repositories b/tests/common/satisfy/t2/repositories new file mode 120000 index 0000000..d965b15 --- /dev/null +++ b/tests/common/satisfy/t2/repositories @@ -0,0 +1 @@ +../repositories \ No newline at end of file diff --git a/tests/common/satisfy/t3/libbaz-1.0.0.tar.gz b/tests/common/satisfy/t3/libbaz-1.0.0.tar.gz new file mode 120000 index 0000000..189242a --- /dev/null +++ b/tests/common/satisfy/t3/libbaz-1.0.0.tar.gz @@ -0,0 +1 @@ +../libbaz-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t3/libfox-1.0.0.tar.gz b/tests/common/satisfy/t3/libfox-1.0.0.tar.gz new file mode 120000 index 0000000..dcfd7aa --- /dev/null +++ b/tests/common/satisfy/t3/libfox-1.0.0.tar.gz @@ -0,0 +1 @@ +../libfox-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t3/repositories b/tests/common/satisfy/t3/repositories new file mode 100644 index 0000000..d65b272 --- /dev/null +++ b/tests/common/satisfy/t3/repositories @@ -0,0 +1,4 @@ +: 1 +location: ../t2 +: + diff --git a/tests/common/satisfy/t4a/libfoo-1.1.0.tar.gz b/tests/common/satisfy/t4a/libfoo-1.1.0.tar.gz new file mode 120000 index 0000000..c004b2a --- /dev/null +++ b/tests/common/satisfy/t4a/libfoo-1.1.0.tar.gz @@ -0,0 +1 @@ +../libfoo-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4a/repositories b/tests/common/satisfy/t4a/repositories new file mode 120000 index 0000000..d965b15 --- /dev/null +++ b/tests/common/satisfy/t4a/repositories @@ -0,0 +1 @@ +../repositories \ No newline at end of file diff --git a/tests/common/satisfy/t4b/libbar-1.1.0.tar.gz b/tests/common/satisfy/t4b/libbar-1.1.0.tar.gz new file mode 120000 index 0000000..b9a2de5 --- /dev/null +++ b/tests/common/satisfy/t4b/libbar-1.1.0.tar.gz @@ -0,0 +1 @@ +../libbar-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4b/repositories b/tests/common/satisfy/t4b/repositories new file mode 100644 index 0000000..7b85e71 --- /dev/null +++ b/tests/common/satisfy/t4b/repositories @@ -0,0 +1,3 @@ +: 1 +location: ../t4a +: diff --git a/tests/common/satisfy/t4c/libbaz-1.1.0.tar.gz b/tests/common/satisfy/t4c/libbaz-1.1.0.tar.gz new file mode 120000 index 0000000..0edbce7 --- /dev/null +++ b/tests/common/satisfy/t4c/libbaz-1.1.0.tar.gz @@ -0,0 +1 @@ +../libbaz-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4c/libfoo-1.0.0.tar.gz b/tests/common/satisfy/t4c/libfoo-1.0.0.tar.gz new file mode 120000 index 0000000..32e5a3c --- /dev/null +++ b/tests/common/satisfy/t4c/libfoo-1.0.0.tar.gz @@ -0,0 +1 @@ +../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4c/repositories b/tests/common/satisfy/t4c/repositories new file mode 100644 index 0000000..26c0e93 --- /dev/null +++ b/tests/common/satisfy/t4c/repositories @@ -0,0 +1,3 @@ +: 1 +location: ../t4b +: diff --git a/tests/common/satisfy/t4d/libbiz-1.0.0.tar.gz b/tests/common/satisfy/t4d/libbiz-1.0.0.tar.gz new file mode 120000 index 0000000..70c2fda --- /dev/null +++ b/tests/common/satisfy/t4d/libbiz-1.0.0.tar.gz @@ -0,0 +1 @@ +../libbiz-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4d/libfox-1.0.0.tar.gz b/tests/common/satisfy/t4d/libfox-1.0.0.tar.gz new file mode 120000 index 0000000..dcfd7aa --- /dev/null +++ b/tests/common/satisfy/t4d/libfox-1.0.0.tar.gz @@ -0,0 +1 @@ +../libfox-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4d/repositories b/tests/common/satisfy/t4d/repositories new file mode 100644 index 0000000..f0e1983 --- /dev/null +++ b/tests/common/satisfy/t4d/repositories @@ -0,0 +1,3 @@ +: 1 +location: ../t4c +: diff --git a/tests/common/satisfy/t5/libbar-1.2.0.tar.gz b/tests/common/satisfy/t5/libbar-1.2.0.tar.gz new file mode 120000 index 0000000..b4a7773 --- /dev/null +++ b/tests/common/satisfy/t5/libbar-1.2.0.tar.gz @@ -0,0 +1 @@ +../libbar-1.2.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t5/repositories b/tests/common/satisfy/t5/repositories new file mode 120000 index 0000000..d965b15 --- /dev/null +++ b/tests/common/satisfy/t5/repositories @@ -0,0 +1 @@ +../repositories \ No newline at end of file diff --git a/tests/common/t1/libfoo-1.0.0.tar.gz b/tests/common/t1/libfoo-1.0.0.tar.gz new file mode 100644 index 0000000..28a6a90 Binary files /dev/null and b/tests/common/t1/libfoo-1.0.0.tar.gz differ diff --git a/tests/common/t1/libfoo-1.1.0.tar.gz b/tests/common/t1/libfoo-1.1.0.tar.gz new file mode 100644 index 0000000..e03481f Binary files /dev/null and b/tests/common/t1/libfoo-1.1.0.tar.gz differ diff --git a/tests/common/t1/repositories b/tests/common/t1/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/common/t1/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/config.test b/tests/config.test new file mode 100644 index 0000000..c40d24b --- /dev/null +++ b/tests/config.test @@ -0,0 +1,27 @@ +# file : tests/config.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Create an empty configuration that will be copied by subsequent tests and +# scopes setup commands. The common approach will be that group scopes copy and +# modify the parent scope configuration as required by the nested tests and +# scopes. Tests will also clone the parent scope configuration to optionally +# modify it, use and cleanup at the end. Note that configuration can not be +# shared between multiple bpkg processes. Also we need to make sure that +# configurations are not cloned while being used by bpkg. +# ++$cfg_create -d cfg 2>- &cfg/*** + +# The most commonly used configuration cloning command that copies it from the +# parent scope working directory. +# +clone_cfg = cp -r ../cfg ./ + +# Clones the original (presumably empty) configuration from the root scope +# working directory. +# +clone_root_cfg = cp -r $~/cfg ./ + +# Setup a test command to use a cloned configuration directory by default. +# +test.arguments += -d cfg diff --git a/tests/default-openssl.cnf b/tests/default-openssl.cnf deleted file mode 100644 index c14ec06..0000000 --- a/tests/default-openssl.cnf +++ /dev/null @@ -1,22 +0,0 @@ -repository = build2.org -company = Code Synthesis -email = info@build2.org - - -[ req ] - -distinguished_name = req_distinguished_name -x509_extensions = v3_req -prompt = no -utf8 = yes - -[ req_distinguished_name ] - -O = $company -CN = name:$repository - -[ v3_req ] - -keyUsage = critical,digitalSignature -extendedKeyUsage = critical,codeSigning -subjectAltName = email:$email diff --git a/tests/key.pem b/tests/key.pem deleted file mode 100644 index 6615a2d..0000000 --- a/tests/key.pem +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKAIBAAKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+IfdyjGMu -34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNPPR58SFNw -wd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH4O3aL2HB -0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXNCJ8uE8yU -cuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2HY478bHLT -2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0HlQIAGOYZz -xbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThubomWaImT -xTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6aI+yGPsWP -AhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+u7jGNUzp -9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqaDZlnVvfw -ozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU4JECAwEA -AQKCAgAz75YlpJq/l5i4XrUusSlYZxRyZNWpjwiFGspox8QwenmnXdF+XmLUwjV5 -UFuMcLwWrzHbzrUdV+5/hHCJHP8aQY3DcOJdlIchqZgdhf61i2yFG9LVJUzueGxP -mtAkc+K8ZcaSzW2BxLSjIyvr9QS+T7cHVsCQtNefvdRMU6P9A1zgDT0g+JnSt8z0 -gPnpvMpVWM67MDfn029tHHf3V+5Bs4A51sXeQpPWENnBJRkW5/zf1J6W3XQR5k3q -KGW1Yk4aATGIfN5BPwax+h70jInlALKOnprJFrnjvn47E1NnT0ceVPF6u2iaIwqX -cCEu1e3flGrrF7Ot9vilG5XL/k8q24LlPrwrjTxgNxoFtSQTHKXWir4hahPEWUJo -lbPxUaVXq0S3OsWxPbj5pAOxP5aZ/vATHsa68tQuErDif4zXhoSU1T06Tcb9pPaP -duVa0QXAy9uiK+NnFbisK7/rC+HTXz7ZdQsAm1XrwkPiLaLbaK30BS0yUNZRjUBc -gQYVShqD6CG9wo9D4HCAPulfcnJ5NqMjTOWDdoY6dAoESD/LYZntjJz5BB0hC9bH -iDIt3yrWjE8khksKvMRyHbzpOq8M6ngZWGTOwMlQ4SEbJaqYfRSK4JN7ePgIMbsE -xAIC8TAPzJNj8Fas8WG2kLTxgMdGe/LcrTL43aR+kkza6MYaVQKCAQEA7cMWLm2f -8vHr1YdBu5gaWIE1TGbZD50akRPjilBBawAXc1ho9B6HdK+l0YYXFe5jRdOWXEn0 -fOUOWR68rkW813kPyWsEGeUfaGUABIomCJIbzV21BvaNgeJIxQIhAr94lX4iVvOh -KyCkZa7NM6lYR77SrLtZgOtZjymnAN/ox78t+AyasRD2ToxoTMfgCPvbPqsCcd7i -SamIZrcGCSiz5eZaIyTgV2z8jcobSO2316LcuYCVUe47Y0Hcdmzqq7pJwym7bsiH -3nypIqVtiSvqXirst56KyAvFAfbhZFy0vx0q4PwkovLZXcdQvmKBkn5wQRIhHlFT -AWLwnxvBW2K+2wKCAQEA64M0tlMhXOW4RxwnJJVuqQJfeRj7Eg8mxJeOSaQIKW/2 -D9G1dqbxzcfzo6G+EFLB8e9qsap4KY1FWHjiqh5P4uheET9AN41YnBw2S8y5eNQn -uJdWU5B39vLfJJ/3A/IiiQ8ok+t2kyZyNpoeu90FKlNL/4mWFhRTCvG+G9ZHFkVJ -eDV7lJrErTpTX0XwHahtrOxrYMu6vj+GYFnoeMcXLsy4fb7d7CZ1qqyyEjwDkdaS -UEtb0MVatWEoBb2eCXDJnWmwwncSfgNWEicV+FNV9NLUrF4SOmeNkF0/GVMMRxZe -lBODoY99UrP6vtukkRJ8B+ObcQu0VwBoHP97zA0sAwKCAQEA3hmzCsPU+nkKuHiU -6sx3L93jD++zLGaxfnx5vaaitXVsco9P21r5ZgL+fu8neZEqovu4JZXgERtXf+C6 -mIEEmrO4D4ssVZQ29qoCjjsOtEroNbsnc820+nOLTp1igNKjreIZ6efD0im36FSV -04CJutuCqWCJh2hSTO2315VSOeVY57G+f1E9BLscYz0DBuFeOPg+XGi8MdtwU6L8 -vGmNQ2EfKl00Q/bHJRx6yHFnnsPANHjtA4/rYhkP/IBZ5vkqFmlRcXdZlHgW9wpZ -fB3N3RFz90LemWiFLASXH82J+k0g1PI0txLsAjJCNtaF+3apHd/1mACX7V+jLr4a -rWdcqQKCAQA/raI7Cg8jRxmkYIBU6/KX0ARwgcihAWfCEBhw4OE0Ewm9DT67bjhD -I6VEwR7a2wWFnO6ES0tiMMhnO4hN5xRCjgGhODDs1FL5Iserhxc/DF4RExpMTeuh -4dlj1by8XGPqGycll6zf7K1FBjb5JLGY2BzcYx8pqSUq+GImtLFT3DgZQJzBeXdk -Pzj7sbVSz4+YCfSen3dGqXZz5ttsjKhAByp7FXh7uYpnM3qSY5ezfwjgnP+eWz5D -fJmNs89fThe1cDZS3k8ps006a0cNdbrwD3Fhia30DLvCJPRCrKnNLscz0nLs5BdG -nVNW95xvfUf7+ha1YizIuVttO8cFTSpxAoIBAET0kO0jKwSYzBBJBMWHlAmYfaiW -WUUYAYpk2jHaK8L4QSNZOvBIEovMCdNN9+D8yQ09HGMxny5+MkSF9CaRRdC1MFfg -bZVlmC+UlzeuMEHalrYVWmIQ29KsF7vo9dKBz1BHMQ77D4lzaV1fZ9EPg+XbbNG2 -6N/rC8ubuC4CjnqMCO0tFM+Gq6ixzDmBkzEWYStEwMQVIkfJ/BxVFHyH8DsRDmvO -1u3lZ7Ks0HyiSOe45q/E6PnNV+oV6f1EeZESZysuD96fHm8XMC6iBwK0AQ0hUZ4e -cVzIsHBEMzLJx6On7xQYR7FNmdW+8fJmMXyniCUS9c26upTNwWVDX+U4Y4M= ------END RSA PRIVATE KEY----- diff --git a/tests/mismatch-openssl.cnf b/tests/mismatch-openssl.cnf deleted file mode 100644 index f4fe4d7..0000000 --- a/tests/mismatch-openssl.cnf +++ /dev/null @@ -1,22 +0,0 @@ -repository = build2.org/auth/mismatched/name/x -company = Code Synthesis -email = info@build2.org - - -[ req ] - -distinguished_name = req_distinguished_name -x509_extensions = v3_req -prompt = no -utf8 = yes - -[ req_distinguished_name ] - -O = $company -CN = name:$repository - -[ v3_req ] - -keyUsage = critical,digitalSignature -extendedKeyUsage = critical,codeSigning -subjectAltName = email:$email diff --git a/tests/noemail-openssl.cnf b/tests/noemail-openssl.cnf deleted file mode 100644 index 4fc8618..0000000 --- a/tests/noemail-openssl.cnf +++ /dev/null @@ -1,20 +0,0 @@ -repository = build2.org -company = Code Synthesis - - -[ req ] - -distinguished_name = req_distinguished_name -x509_extensions = v3_req -prompt = no -utf8 = yes - -[ req_distinguished_name ] - -O = $company -CN = name:$repository - -[ v3_req ] - -keyUsage = critical,digitalSignature -extendedKeyUsage = critical,codeSigning diff --git a/tests/pkg-build.test b/tests/pkg-build.test new file mode 100644 index 0000000..763574b --- /dev/null +++ b/tests/pkg-build.test @@ -0,0 +1,1239 @@ +# file : tests/pkg-build.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test remote.test + +# Source repository: +# +# pkg-build +# |-- libbar-1.0.0.tar.gz +# |-- libbaz-1.1.0.tar.gz +# |-- libfoo-0.0.1.tar.gz +# |-- libfoo-1.0.0.tar.gz +# |-- libfoo-1.1.0 +# | |-- build +# | | `-- bootstrap.build +# | |-- buildfile +# | `-- manifest +# |-- libfoo-1.1.0.tar.gz +# |-- libfoo-1.2.0.tar.gz +# |-- t1 +# | |-- libfoo-1.0.0.tar.gz +# | `-- repositories +# |-- t2 +# | |-- libbar-1.0.0.tar.gz -> libfoo +# | |-- libfoo-1.0.0.tar.gz +# | `-- repositories +# |-- t3 -> t2 (prerequisite) +# | |-- libbaz-1.0.0.tar.gz -> libbar +# | |-- libfox-1.0.0.tar.gz +# | `-- repositories +# |-- t4a +# | |-- libfoo-1.1.0.tar.gz +# | `-- repositories +# |-- t4b -> t4a (prerequisite) +# | |-- libbar-1.1.0.tar.gz -> libfoo == 1.1.0 +# | `-- repositories +# |-- t4c -> t4b (prerequisite) +# | |-- libbaz-1.1.0.tar.gz -> libfoo, libbar +# | |-- libfoo-1.0.0.tar.gz +# | `-- repositories +# |-- t4d -> t4c (prerequisite) +# | |-- libbiz-1.0.0.tar.gz -> libfox, libfoo, libbaz +# | |-- libfox-1.0.0.tar.gz +# | `-- repositories +# `-- t5 +# |-- libbar-1.2.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + cp -r $src/t1 $out/t1 && $rep_create $out/t1 &$out/t1/packages + cp -r $src/t2 $out/t2 && $rep_create $out/t2 &$out/t2/packages + cp -r $src/t3 $out/t3 && $rep_create $out/t3 &$out/t3/packages + cp -r $src/t4a $out/t4a && $rep_create $out/t4a &$out/t4a/packages + cp -r $src/t4b $out/t4b && $rep_create $out/t4b &$out/t4b/packages + cp -r $src/t4c $out/t4c && $rep_create $out/t4c &$out/t4c/packages + cp -r $src/t4d $out/t4d && $rep_create $out/t4d &$out/t4d/packages + cp -r $src/t5 $out/t5 && $rep_create $out/t5 &$out/t5/packages +end + +pkg_configure += -d cfg "config.cxx=$config.cxx" 2>- +pkg_disfigure += -d cfg +pkg_fetch += -d cfg 2>- +pkg_purge += -d cfg +pkg_status += -d cfg +pkg_unpack += -d cfg 2>- +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all --trust-yes 2>- + +: libfoo +: +: Test building different versions of libfoo. +: +{ + test.arguments += --print-only + + : no-name + : + $clone_root_cfg; + $* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-build' for more information + EOE + + : unknown-package + : + $clone_root_cfg; + $* libfoo 2>>/EOE != 0 + error: unknown package libfoo + info: configuration cfg/ has no repositories + info: use 'bpkg rep-add' to add a repository + EOE + + : unknown-package-ver + : + $clone_root_cfg; + $* libfoo/1.0.0 2>>/EOE != 0 + error: unknown package libfoo + info: configuration cfg/ has no repositories + info: use 'bpkg rep-add' to add a repository + EOE + + : archive + : + $clone_root_cfg; + $* $src/libfoo-1.1.0.tar.gz >'build libfoo/1.1.0' + + : dir + : + $clone_root_cfg; + $* $src/libfoo-1.1.0/ >'build libfoo/1.1.0' + + : unpacked-dir + : + { + $clone_root_cfg && $pkg_unpack -e $src/libfoo-1.1.0; + + $* libfoo >'build libfoo/1.1.0'; + $* libfoo/1.1.0 >'build libfoo/1.1.0'; + $* libfoo libfoo >'build libfoo/1.1.0'; + + $* libfoo libfoo/1.1.0 2>>EOE != 0; + error: duplicate package libfoo + info: first mentioned as libfoo + info: second mentioned as libfoo/1.1.0 + EOE + + $* libfoo/1.1.0 libfoo 2>>EOE != 0; + error: duplicate package libfoo + info: first mentioned as libfoo/1.1.0 + info: second mentioned as libfoo + EOE + + $* libfoo/1.1.0 libfoo/1.1.0 >'build libfoo/1.1.0'; + + $* libfoo/1.0.0 2>>/EOE != 0; + error: unknown package libfoo + info: configuration cfg/ has no repositories + info: use 'bpkg rep-add' to add a repository + EOE + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : t1 + : + { + +$clone_root_cfg && $rep_add $rep/t1 && $rep_fetch + + : downgrade + : + { + $clone_cfg && $pkg_unpack -e $src/libfoo-1.1.0; + + $* libfoo >'build libfoo/1.1.0'; + $* libfoo/1.0.0 >'downgrade libfoo/1.0.0'; + + $* libfoo/0.0.1 2>>EOE != 0; + error: libfoo/0.0.1 is not available in source + info: specify sys:libfoo/0.0.1 if it is available from the system + EOE + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : upgrade + : + { + $clone_cfg; + $pkg_fetch -e $src/libfoo-0.0.1.tar.gz && $pkg_unpack libfoo; + + $* libfoo >'upgrade libfoo/1.0.0'; + $* libfoo/0.0.1 >'build libfoo/0.0.1'; + + $* libfoo/1.1.0 2>>EOE != 0; + error: libfoo/1.1.0 is not available in source + info: specify sys:libfoo/1.1.0 if it is available from the system + EOE + + $pkg_purge libfoo 2>'purged libfoo/0.0.1' + } + + : upgrade-failure + : + { + $clone_cfg; + + $* libfoo >'build libfoo/1.0.0'; + $* libfoo/1.0.0 >'build libfoo/1.0.0'; + + $* libfoo/1.1.0 2>>EOE != 0 + error: libfoo/1.1.0 is not available in source + info: specify sys:libfoo/1.1.0 if it is available from the system + EOE + } + } +} + +: libbar-libfoo +: +: Test building libbar that depends on libfoo. +: +{ + test.arguments += --print-only + + : unknown-prerequisite + : + $clone_root_cfg; + $* $src/libbar-1.0.0.tar.gz 2>>EOE != 0 + error: unknown prerequisite libfoo of package libbar + info: while satisfying libbar/1.0.0 + EOE + + : t2 + : + { + +$clone_root_cfg && $rep_add $rep/t2 && $rep_fetch + + : build-prerequisite + : + { + $clone_cfg; + + $* libbar >>EOO; + build libfoo/1.0.0 (required by libbar) + build libbar/1.0.0 + EOO + + $* libbar libfoo >>EOO; + build libfoo/1.0.0 + build libbar/1.0.0 + EOO + + $* libbar libfoo/1.0.0 >>EOO; + build libfoo/1.0.0 + build libbar/1.0.0 + EOO + + $* libbar libfoo libbar/1.0.0 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as libbar + info: second mentioned as libbar/1.0.0 + EOE + + $* libbar libfoo/1.1.0 2>>EOE != 0 + error: libfoo/1.1.0 is not available in source + info: specify sys:libfoo/1.1.0 if it is available from the system + EOE + } + + : upgrade-prerequisite + : + { + $clone_cfg; + $pkg_fetch -e $src/libfoo-0.0.1.tar.gz && $pkg_unpack libfoo; + + $* libbar >>EOO; + build libfoo/0.0.1 (required by libbar) + build libbar/1.0.0 + EOO + + $* libbar libfoo >>EOO; + upgrade libfoo/1.0.0 + build libbar/1.0.0 + EOO + + $* libbar libfoo/0.0.1 >>EOO; + build libfoo/0.0.1 + build libbar/1.0.0 + EOO + + $pkg_purge libfoo 2>'purged libfoo/0.0.1' + } + + : downgrade-prerequisite + : + { + $clone_cfg && $pkg_unpack -e $src/libfoo-1.1.0; + + $* libbar >>EOO; + build libfoo/1.1.0 (required by libbar) + build libbar/1.0.0 + EOO + + $* libbar libfoo >>EOO; + build libfoo/1.1.0 + build libbar/1.0.0 + EOO + + $* libbar libfoo/1.0.0 >>EOO; + downgrade libfoo/1.0.0 + build libbar/1.0.0 + EOO + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + } +} + +: libbaz-libbar +: +: Test building libbaz that depends on libbar; libbar is in prerequisite +: repository. +: +{ + test.arguments += --print-only + + : t3 + : + { + +$clone_root_cfg && $rep_add $rep/t3 && $rep_fetch + + : prerequisites-build-failure + : + : Fail to build packages that are only in prerequisite repository. + : + { + $clone_cfg; + + $* libfoo 2>>EOE != 0; + error: unknown package libfoo + EOE + + $* libbar 2>>EOE != 0; + error: unknown package libbar + EOE + + $* libbaz libbar 2>>EOE != 0 + error: unknown package libbar + EOE + } + + : prerequisites-build + : + $clone_cfg; + $* libbaz >>EOO + build libfoo/1.0.0 (required by libbar) + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : different-build-order + : + { + +$clone_cfg && $rep_add $rep/t2 && $rep_fetch + + : fox-foo + : + $clone_cfg; + $* libfox libfoo >>EOO + build libfox/1.0.0 + build libfoo/1.0.0 + EOO + + : foo-fox + : + $clone_cfg; + $* libfoo libfox >>EOO + build libfoo/1.0.0 + build libfox/1.0.0 + EOO + + : baz-foo + : + $clone_cfg; + $* libbaz libfoo >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : foo-baz + : + $clone_cfg; + $* libfoo libbaz >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : baz-fox + : + $clone_cfg; + $* libbaz libfox >>EOO + build libfoo/1.0.0 (required by libbar) + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + build libfox/1.0.0 + EOO + + : fox-baz + : + $clone_cfg; + $* libfox libbaz >>EOO + build libfox/1.0.0 + build libfoo/1.0.0 (required by libbar) + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : fox-foo-baz + : + $clone_cfg; + $* libfox libfoo libbaz >>EOO + build libfox/1.0.0 + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : fox-baz-foo + : + $clone_cfg; + $* libfox libbaz libfoo >>EOO + build libfox/1.0.0 + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : foo-fox-baz + : + $clone_cfg; + $* libfoo libfox libbaz >>EOO + build libfoo/1.0.0 + build libfox/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : foo-baz-fox + : + $clone_cfg; + $* libfoo libbaz libfox >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + build libfox/1.0.0 + EOO + + : baz-fox-foo + : + : This one is contradictory: baz before fox but fox before foo. + : + $clone_cfg; + $* libbaz libfox libfoo >>EOO + build libfox/1.0.0 + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + EOO + + : baz-foo-fox + : + $clone_cfg; + $* libbaz libfoo libfox >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 (required by libbaz) + build libbaz/1.0.0 + build libfox/1.0.0 + EOO + + : baz-foo-bar + : + $clone_cfg; + $* libbaz libfoo libbar >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 + build libbaz/1.0.0 + EOO + + : baz-bar-foo + : + $clone_cfg; + $* libbaz libbar libfoo >>EOO + build libfoo/1.0.0 + build libbar/1.0.0 + build libbaz/1.0.0 + EOO + } + } +} + +: libbaz-libfoo-libbar +: +: Test building libbaz that depends on libfoo and libbar; libbar depends on +: libfoo >= 1.1.0. +: +{ + test.arguments += --print-only + + : t4c + : + { + +$clone_root_cfg && $rep_add $rep/t4c && $rep_fetch + + : baz + : + $clone_cfg; + $* libbaz >>EOO + build libfoo/1.1.0 (required by libbar libbaz) + build libbar/1.1.0 (required by libbaz) + build libbaz/1.1.0 + EOO + + : foo-baz + : + $clone_cfg; + $* libfoo libbaz >>EOO + build libfoo/1.1.0 + build libbar/1.1.0 (required by libbaz) + build libbaz/1.1.0 + EOO + + : unable-satisfy + : + $clone_cfg; + $* libfoo/1.0.0 libbaz 2>>EOE != 0 + error: unable to satisfy constraints on package libfoo + info: libbar depends on (libfoo == 1.1.0) + info: command line depends on (libfoo == 1.0.0) + info: available libfoo/1.1.0 + info: available libfoo/1.0.0 + info: explicitly specify libfoo version to manually satisfy both constraints + info: while satisfying libbar/1.1.0 + info: while satisfying libbaz/1.1.0 + EOE + + : not-available + : + $clone_cfg; + $* libfoo/1.1.0 libbaz 2>>EOE != 0 + error: libfoo/1.1.0 is not available in source + info: specify sys:libfoo/1.1.0 if it is available from the system + EOE + + : upgrade-warning + : + { + $clone_cfg; + $pkg_fetch -e $src/libfoo-0.0.1.tar.gz && $pkg_unpack libfoo; + + $* libbaz >>EOO 2>>EOE; + upgrade libfoo/1.1.0 (required by libbar libbaz) + build libbar/1.1.0 (required by libbaz) + build libbaz/1.1.0 + EOO + warning: package libbar dependency on (libfoo == 1.1.0) is forcing upgrade of libfoo/0.0.1 to 1.1.0 + EOE + + $pkg_purge libfoo 2>'purged libfoo/0.0.1' + } + + : downgrade-error + : + { + $clone_cfg; + $pkg_fetch -e $src/libfoo-1.2.0.tar.gz && $pkg_unpack libfoo; + + $* libbaz 2>>EOE != 0; + error: package libbar dependency on (libfoo == 1.1.0) is forcing downgrade of libfoo/1.2.0 to 1.1.0 + info: explicitly request version downgrade to continue + info: while satisfying libbar/1.1.0 + info: while satisfying libbaz/1.1.0 + EOE + + $rep_add $rep/t4a && $rep_fetch; + + $* libfoo/1.1.0 libbaz >>EOO; + downgrade libfoo/1.1.0 + build libbar/1.1.0 (required by libbaz) + build libbaz/1.1.0 + EOO + + $pkg_purge libfoo 2>'purged libfoo/1.2.0' + } + + : unable-downgrade + : + : Test that dependent prevents up/downgrade that would break dependency + : constraints. + : + { + $clone_cfg; + $pkg_fetch libfoo/1.1.0 && $pkg_unpack libfoo && $pkg_configure libfoo; + $pkg_fetch libbar/1.1.0 && $pkg_unpack libbar && $pkg_configure libbar; + + $* libfoo-1.2.0.tar.gz 2>>EOE != 0; + error: unknown package libfoo-1.2.0.tar.gz + EOE + + $* libfoo/1.0.0 2>>EOE != 0; + error: unable to downgrade package libfoo/1.1.0 to 1.0.0 + info: because package libbar depends on (libfoo == 1.1.0) + info: explicitly request up/downgrade of package libbar + info: or explicitly specify package libfoo version to manually satisfy these constraints + EOE + + $* libfoo/1.1.0 >'build libfoo/1.1.0'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + } + + : dependent-reconfiguration + : + { + +$clone_root_cfg + + +$pkg_fetch -e $src/libfoo-1.0.0.tar.gz && $pkg_unpack libfoo + +$pkg_configure libfoo + + +$pkg_fetch -e $src/libbar-1.0.0.tar.gz && $pkg_unpack libbar + +$pkg_configure libbar + + +$pkg_fetch -e $src/libbaz-1.1.0.tar.gz && $pkg_unpack libbaz + +$pkg_configure libbaz + + +$rep_add $rep/t4a && $rep_add $rep/t4b && $rep_fetch + + : bar + : + $clone_cfg; + $* libbar >>EOO 2>>EOE + upgrade libfoo/1.1.0 (required by libbar libbaz) + upgrade libbar/1.1.0 + reconfigure libbaz (dependent of libbar) + EOO + warning: package libbar dependency on (libfoo == 1.1.0) is forcing upgrade of libfoo/1.0.0 to 1.1.0 + EOE + + : foo + : + $clone_cfg; + $* libfoo >>EOO + upgrade libfoo/1.1.0 + reconfigure libbar (dependent of libfoo) + reconfigure libbaz (dependent of libbar) + EOO + + : foo-bar + : + $clone_cfg; + $* libfoo libbar/1.0.0 >>EOO + upgrade libfoo/1.1.0 + reconfigure/build libbar/1.0.0 + reconfigure libbaz (dependent of libbar) + EOO + + : bar-foo + : + $clone_cfg; + $* libbar/1.0.0 libfoo >>EOO + upgrade libfoo/1.1.0 + reconfigure/build libbar/1.0.0 + reconfigure libbaz (dependent of libbar) + EOO + + : baz-foo + : + $clone_cfg; + $* libbaz libfoo >>EOO + upgrade libfoo/1.1.0 + reconfigure libbar (dependent of libbaz libfoo) + reconfigure/build libbaz/1.1.0 + EOO + + : baz-foo-1.0.0 + : + $clone_cfg; + $* libbaz libfoo/1.0.0 >>EOO + build libfoo/1.0.0 + build libbaz/1.1.0 + EOO + + -$pkg_disfigure libbaz 2>'disfigured libbaz/1.1.0' + -$pkg_purge libbaz 2>'purged libbaz/1.1.0' + + -$pkg_disfigure libbar 2>'disfigured libbar/1.0.0' + -$pkg_purge libbar 2>'purged libbar/1.0.0' + + -$pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0' + -$pkg_purge libfoo 2>'purged libfoo/1.0.0' + } +} + +# Note that when we fetch a package from remote repository the bpkg stderr +# contains fetch program progress output, that comes prior the informational +# message. +# + +: actual-build +: +{ + test.arguments += --yes + + : wth-prerequisites + : + { + $clone_root_cfg && $rep_add $rep/t4c && $rep_fetch; + + $* libbaz 2>>~%EOE%; + %.* + %.*fetched libfoo/1.1.0% + unpacked libfoo/1.1.0 + %.* + %.*fetched libbar/1.1.0% + unpacked libbar/1.1.0 + %.* + %.*fetched libbaz/1.1.0% + unpacked libbaz/1.1.0 + configured libfoo/1.1.0 + configured libbar/1.1.0 + configured libbaz/1.1.0 + %info: dir.+libbaz-1.1.0.+ is up to date% + updated libbaz/1.1.0 + EOE + + $pkg_status libfoo/1.1.0 >'configured; available'; + $pkg_status libbar/1.1.0 >'configured'; + $pkg_status libbaz/1.1.0 >'configured hold_package; available'; + + $pkg_disfigure libbaz 2>'disfigured libbaz/1.1.0'; + $pkg_purge libbaz 2>'purged libbaz/1.1.0'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : hold-fs-fetched + : + { + : direct + : + { + $clone_root_cfg; + + $* $src/libfoo-1.0.0.tar.gz 2>>~%EOE%; + fetched libfoo/1.0.0 + unpacked libfoo/1.0.0 + configured libfoo/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package hold_version'; + + $* $src/libfoo-1.1.0/ 2>>~%EOE%; + disfigured libfoo/1.0.0 + unpacked libfoo/1.1.0 + configured libfoo/1.1.0 + %info: dir.+libfoo-1.1.0.+ is up to date% + updated libfoo/1.1.0 + EOE + + $pkg_status libfoo >'configured 1.1.0 hold_package hold_version'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : pre-fetch + : + { + $clone_root_cfg; + $pkg_fetch -e $src/libfoo-1.0.0.tar.gz && $pkg_unpack libfoo; + $pkg_configure libfoo; + + $pkg_status libfoo >'configured 1.0.0'; + + $* libfoo 2>>~%EOE%; + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + } + + : hold-repo-fetched + : + { + +$clone_root_cfg && $rep_add $rep/t4c && $rep_fetch + + : package-version + : + { + $clone_cfg; + + $* libfoo 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + configured libfoo/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package; available sys:?'; + + $* libfoo/1.0.0 2>>~%EOE%; + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package hold_version; available sys:?'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : version + : + { + $clone_cfg; + + $* libfoo/1.0.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + configured libfoo/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package hold_version; available sys:?'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : not-held + : + { + $clone_cfg; + + $* libbaz 2>>~%EOE%; + %.* + %.*fetched libfoo/1.1.0% + unpacked libfoo/1.1.0 + %.* + %.*fetched libbar/1.1.0% + unpacked libbar/1.1.0 + %.* + %.*fetched libbaz/1.1.0% + unpacked libbaz/1.1.0 + configured libfoo/1.1.0 + configured libbar/1.1.0 + configured libbaz/1.1.0 + %info: dir.+libbaz-1.1.0.+ is up to date% + updated libbaz/1.1.0 + EOE + + $pkg_status libfoo >'configured 1.1.0; available sys:?'; + + $pkg_disfigure libbaz 2>'disfigured libbaz/1.1.0'; + $pkg_purge libbaz 2>'purged libbaz/1.1.0'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : forcing-upgrade-unheld + : + { + $clone_cfg; + + $* libfoo 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + configured libfoo/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package; available sys:?'; + + $* libbaz 2>>~%EOE%; + warning: package libbar dependency on (libfoo == 1.1.0) is forcing upgrade of libfoo/1.0.0 to 1.1.0 + disfigured libfoo/1.0.0 + %.* + %.*fetched libfoo/1.1.0% + unpacked libfoo/1.1.0 + %.* + %.*fetched libbar/1.1.0% + unpacked libbar/1.1.0 + %.* + %.*fetched libbaz/1.1.0% + unpacked libbaz/1.1.0 + configured libfoo/1.1.0 + configured libbar/1.1.0 + configured libbaz/1.1.0 + %info: dir.+libbaz-1.1.0.+ is up to date% + updated libbaz/1.1.0 + EOE + + $pkg_status libfoo >'configured 1.1.0 hold_package; available sys:?'; + + $pkg_disfigure libbaz 2>'disfigured libbaz/1.1.0'; + $pkg_purge libbaz 2>'purged libbaz/1.1.0'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : forcing-upgrade-held + : + { + $clone_cfg; + + $* libfoo/1.0.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + configured libfoo/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + updated libfoo/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package hold_version; available sys:?'; + + $* libbaz 2>>EOE != 0; + error: package libbar dependency on (libfoo == 1.1.0) is forcing upgrade of libfoo/1.0.0 to 1.1.0 + info: package version libfoo/1.0.0 is held + info: explicitly request version upgrade to continue + info: while satisfying libbar/1.1.0 + info: while satisfying libbaz/1.1.0 + EOE + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + } + + : drop-prerequisites + : + { + $clone_root_cfg && $rep_add $rep/t2 && $rep_fetch; + + $* libbar 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: dir.+libbar-1.0.0.+ is up to date% + updated libbar/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0; available sys:?'; + $pkg_status libbar >'configured 1.0.0 hold_package; available sys:?'; + + $rep_add $rep/t5 && $rep_fetch; + + $* libbar 2>>~%EOE%; + disfigured libbar/1.0.0 + %.* + %.*fetched libbar/1.2.0% + unpacked libbar/1.2.0 + configured libbar/1.2.0 + disfigured libfoo + purged libfoo + %info: dir.+libbar-1.2.0.+ is up to date% + updated libbar/1.2.0 + EOE + + $pkg_status libfoo >'available 1.0.0 sys:?'; + $pkg_status libbar >'configured 1.2.0 hold_package; available sys:?'; + + $* libbar/1.0.0 libfoo 2>>~%EOE%; + disfigured libbar/1.2.0 + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: dir.+libfoo-1.0.0.+ is up to date% + %info: dir.+libbar-1.0.0.+ is up to date% + updated libfoo/1.0.0 + updated libbar/1.0.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package; available sys:?'; + $pkg_status libbar >'configured 1.0.0 hold_package hold_version; available 1.2.0 sys:?'; + + $* libbar 2>>~%EOE%; + disfigured libbar/1.0.0 + %.* + %.*fetched libbar/1.2.0% + unpacked libbar/1.2.0 + configured libbar/1.2.0 + %info: dir.+libbar-1.2.0.+ is up to date% + updated libbar/1.2.0 + EOE + + $pkg_status libfoo >'configured 1.0.0 hold_package; available sys:?'; + $pkg_status libbar >'configured 1.2.0 hold_package; available sys:?'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.2.0'; + $pkg_purge libbar 2>'purged libbar/1.2.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } +} + +: prerequisite +: +{ + +$clone_cfg + +$rep_add $rep/t2 && $rep_add $rep/t5 && $rep_fetch + + : drop + : + : Test --drop-prerequisite option. + : + { + $clone_cfg; + + $* --yes libbar/1.0.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: dir.+ is up to date% + updated libbar/1.0.0 + EOE + + $* --drop-prerequisite libbar/1.2.0 <'y' 2>>~%EOE%; + upgrade libbar/1.2.0 + continue? [Y/n] disfigured libbar/1.0.0 + %.* + %.*fetched libbar/1.2.0% + unpacked libbar/1.2.0 + configured libbar/1.2.0 + disfigured libfoo + purged libfoo + %info: .+ is up to date% + updated libbar/1.2.0 + EOE + + $pkg_status libfoo >'available 1.0.0 sys:?'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.2.0'; + $pkg_purge libbar 2>'purged libbar/1.2.0' + } + + : keep + : + : Test --keep-prerequisite option. + : + { + $clone_cfg; + + $* --yes libbar/1.0.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: dir.+ is up to date% + updated libbar/1.0.0 + EOE + + $* --keep-prerequisite libbar/1.2.0 <'y' 2>>~%EOE%; + upgrade libbar/1.2.0 + continue? [Y/n] disfigured libbar/1.0.0 + %.* + %.*fetched libbar/1.2.0% + unpacked libbar/1.2.0 + configured libbar/1.2.0 + %info: .+ is up to date% + updated libbar/1.2.0 + EOE + + $pkg_status libfoo >'configured 1.0.0; available sys:?'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.2.0'; + $pkg_purge libbar 2>'purged libbar/1.2.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } +} + +: dependent +: +{ + +$clone_cfg + +$rep_add $rep/t2 && $rep_fetch + + : update + : + : Test --update-dependent option. + : + { + $clone_cfg; + + $* --yes libbar 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: .+ is up to date% + updated libbar/1.0.0 + EOE + + $rep_add $rep/t4a && $rep_fetch; + + $* --update-dependent libfoo/1.1.0 <'y' 2>>~%EOE%; + upgrade libfoo/1.1.0 + reconfigure libbar (dependent of libfoo) + continue? [Y/n] disfigured libbar/1.0.0 + disfigured libfoo/1.0.0 + %.* + %.*fetched libfoo/1.1.0% + unpacked libfoo/1.1.0 + configured libfoo/1.1.0 + configured libbar/1.0.0 + %info: .+ is up to date% + %info: .+ is up to date% + updated libfoo/1.1.0 + updated libbar/1.0.0 + EOE + + $pkg_disfigure libbar 2>'disfigured libbar/1.0.0'; + $pkg_purge libbar 2>'purged libbar/1.0.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : leave + : + : Test --leave-dependent option. + : + { + $clone_cfg; + + $* --yes libbar 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + %info: .+ is up to date% + updated libbar/1.0.0 + EOE + + $rep_add $rep/t4a && $rep_fetch; + + $* --leave-dependent libfoo/1.1.0 <'y' 2>>~%EOE%; + upgrade libfoo/1.1.0 + reconfigure libbar (dependent of libfoo) + continue? [Y/n] disfigured libbar/1.0.0 + disfigured libfoo/1.0.0 + %.* + %.*fetched libfoo/1.1.0% + unpacked libfoo/1.1.0 + configured libfoo/1.1.0 + configured libbar/1.0.0 + %info: .+ is up to date% + updated libfoo/1.1.0 + EOE + + $pkg_disfigure libbar 2>'disfigured libbar/1.0.0'; + $pkg_purge libbar 2>'purged libbar/1.0.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } +} + +: configure-only +: +: Test --configure-only option. +: +{ + $clone_cfg; + $rep_add $rep/t2 && $rep_fetch; + + $* --configure-only --yes libbar 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + unpacked libfoo/1.0.0 + %.* + %.*fetched libbar/1.0.0% + unpacked libbar/1.0.0 + configured libfoo/1.0.0 + configured libbar/1.0.0 + EOE + + $pkg_disfigure libbar 2>'disfigured libbar/1.0.0'; + $pkg_purge libbar 2>'purged libbar/1.0.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' +} diff --git a/tests/pkg-build/libbar-1.0.0.tar.gz b/tests/pkg-build/libbar-1.0.0.tar.gz new file mode 120000 index 0000000..643487e --- /dev/null +++ b/tests/pkg-build/libbar-1.0.0.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libbar-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/libbaz-1.1.0.tar.gz b/tests/pkg-build/libbaz-1.1.0.tar.gz new file mode 120000 index 0000000..c3a33c8 --- /dev/null +++ b/tests/pkg-build/libbaz-1.1.0.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libbaz-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/libfoo-0.0.1.tar.gz b/tests/pkg-build/libfoo-0.0.1.tar.gz new file mode 120000 index 0000000..0f1802e --- /dev/null +++ b/tests/pkg-build/libfoo-0.0.1.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libfoo-0.0.1.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/libfoo-1.0.0.tar.gz b/tests/pkg-build/libfoo-1.0.0.tar.gz new file mode 120000 index 0000000..4f215aa --- /dev/null +++ b/tests/pkg-build/libfoo-1.0.0.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/libfoo-1.1.0 b/tests/pkg-build/libfoo-1.1.0 new file mode 120000 index 0000000..c991a82 --- /dev/null +++ b/tests/pkg-build/libfoo-1.1.0 @@ -0,0 +1 @@ +../common/satisfy/libfoo-1.1.0 \ No newline at end of file diff --git a/tests/pkg-build/libfoo-1.1.0.tar.gz b/tests/pkg-build/libfoo-1.1.0.tar.gz new file mode 120000 index 0000000..4c8bb75 --- /dev/null +++ b/tests/pkg-build/libfoo-1.1.0.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libfoo-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/libfoo-1.2.0.tar.gz b/tests/pkg-build/libfoo-1.2.0.tar.gz new file mode 120000 index 0000000..a6cc8b7 --- /dev/null +++ b/tests/pkg-build/libfoo-1.2.0.tar.gz @@ -0,0 +1 @@ +../common/satisfy/libfoo-1.2.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-build/t1 b/tests/pkg-build/t1 new file mode 120000 index 0000000..c7c69d2 --- /dev/null +++ b/tests/pkg-build/t1 @@ -0,0 +1 @@ +../common/satisfy/t1 \ No newline at end of file diff --git a/tests/pkg-build/t2 b/tests/pkg-build/t2 new file mode 120000 index 0000000..0f8869b --- /dev/null +++ b/tests/pkg-build/t2 @@ -0,0 +1 @@ +../common/satisfy/t2 \ No newline at end of file diff --git a/tests/pkg-build/t3 b/tests/pkg-build/t3 new file mode 120000 index 0000000..df69aba --- /dev/null +++ b/tests/pkg-build/t3 @@ -0,0 +1 @@ +../common/satisfy/t3 \ No newline at end of file diff --git a/tests/pkg-build/t4a b/tests/pkg-build/t4a new file mode 120000 index 0000000..47997b2 --- /dev/null +++ b/tests/pkg-build/t4a @@ -0,0 +1 @@ +../common/satisfy/t4a \ No newline at end of file diff --git a/tests/pkg-build/t4b b/tests/pkg-build/t4b new file mode 120000 index 0000000..917299c --- /dev/null +++ b/tests/pkg-build/t4b @@ -0,0 +1 @@ +../common/satisfy/t4b \ No newline at end of file diff --git a/tests/pkg-build/t4c b/tests/pkg-build/t4c new file mode 120000 index 0000000..06b7611 --- /dev/null +++ b/tests/pkg-build/t4c @@ -0,0 +1 @@ +../common/satisfy/t4c \ No newline at end of file diff --git a/tests/pkg-build/t4d b/tests/pkg-build/t4d new file mode 120000 index 0000000..56dc0f7 --- /dev/null +++ b/tests/pkg-build/t4d @@ -0,0 +1 @@ +../common/satisfy/t4d \ No newline at end of file diff --git a/tests/pkg-build/t5 b/tests/pkg-build/t5 new file mode 120000 index 0000000..58fcea2 --- /dev/null +++ b/tests/pkg-build/t5 @@ -0,0 +1 @@ +../common/satisfy/t5 \ No newline at end of file diff --git a/tests/pkg-clean.test b/tests/pkg-clean.test new file mode 100644 index 0000000..c090036 --- /dev/null +++ b/tests/pkg-clean.test @@ -0,0 +1,133 @@ +# file : tests/pkg-clean.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# pkg-clean +# |-- hello +# | |-- libhello-1.0.0.tar.gz +# | `-- repositories +# `-- libhello-1.0.0 +# |-- build +# | |-- bootstrap.build +# | |-- export.build +# | `-- root.build +# |-- buildfile +# |-- hello +# | |-- buildfile +# | |-- export +# | |-- hello +# | `-- hello.cxx +# |-- INSTALL +# |-- manifest +# |-- tests +# | |-- build +# | | |-- bootstrap.build +# | | `-- root.build +# | |-- buildfile +# | `-- test +# | |-- buildfile +# | |-- driver.cxx +# | `-- test.out +# `-- version + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature +end + +pkg_configure += -d cfg "config.cxx=$config.cxx" 2>- +pkg_disfigure += -d cfg +pkg_fetch += -d cfg 2>- +pkg_purge += -d cfg +pkg_unpack += -d cfg 2>- +pkg_update += -d cfg 2>- +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all 2>- + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-clean' for more information + EOE + +: fetched +: +{ + +$clone_cfg + +$rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/*** + + : no-such-package + : + $clone_cfg; + $* libhello 2>>/EOE != 0 + error: package libhello does not exist in configuration cfg/ + EOE + + : wrong-state + : + { + $clone_cfg && $pkg_fetch libhello/1.0.0; + + $* libhello 2>>EOE != 0; + error: package libhello is fetched + info: expected it to be configured + EOE + + $pkg_purge libhello 2>'purged libhello/1.0.0' + } + + : src-eq-out + : + { + $clone_cfg; + $pkg_fetch libhello/1.0.0 && $pkg_unpack libhello; + $pkg_configure libhello && $pkg_update libhello; + + $* libhello 2>>~%EOE%; + %.{6} + cleaned libhello/1.0.0 + EOE + + $* libhello 2>>~%EOE%; + %info: .+ is clean% + cleaned libhello/1.0.0 + EOE + + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_purge libhello 2>'purged libhello/1.0.0' + } +} + +: src-ne-out +: +{ + $clone_cfg; + $pkg_unpack -e $src/libhello-1.0.0; + $pkg_configure libhello && $pkg_update libhello; + + $* libhello 2>>~%EOE%; + %.{8} + cleaned libhello/1.0.0 + EOE + + $* libhello 2>>~%EOE%; + %info: .+ is clean% + cleaned libhello/1.0.0 + EOE + + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_purge libhello 2>'purged libhello/1.0.0' +} diff --git a/tests/pkg-clean/hello b/tests/pkg-clean/hello new file mode 120000 index 0000000..e10a7f8 --- /dev/null +++ b/tests/pkg-clean/hello @@ -0,0 +1 @@ +../common/hello \ No newline at end of file diff --git a/tests/pkg-clean/libhello-1.0.0 b/tests/pkg-clean/libhello-1.0.0 new file mode 120000 index 0000000..a6f638b --- /dev/null +++ b/tests/pkg-clean/libhello-1.0.0 @@ -0,0 +1 @@ +../common/libhello-1.0.0 \ No newline at end of file diff --git a/tests/pkg-configure.test b/tests/pkg-configure.test new file mode 100644 index 0000000..098b1a9 --- /dev/null +++ b/tests/pkg-configure.test @@ -0,0 +1,389 @@ +# file : tests/pkg-configure.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Here we test both pkg-configure and pkg-disfigure commands. +# + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# pkg-configure +# |-- hello +# | |-- libhello-1.0.0.tar.gz +# | `-- repositories +# |-- libhello-1.0.0 +# | |-- build +# | | |-- bootstrap.build +# | | |-- export.build +# | | `-- root.build +# | |-- buildfile +# | |-- hello +# | | |-- buildfile +# | | |-- export +# | | |-- hello +# | | `-- hello.cxx +# | |-- INSTALL +# | |-- manifest +# | |-- tests +# | | |-- build +# | | | |-- bootstrap.build +# | | | `-- root.build +# | | |-- buildfile +# | | `-- test +# | | |-- buildfile +# | | |-- driver.cxx +# | | `-- test.out +# | `-- version +# `-- stable +# |-- libbar-1.0.0.tar.gz -> libfoo +# |-- libbar-1.1.0.tar.gz -> libfoo >= 1.1.0 +# |-- libbar-1.2.0.tar.gz -> libfoo >= 1.1.0, libfox | libfoo >= 1.2.0 +# |-- libbar-1.3.0.tar.gz -> libfox | libfoo <= 1.1.0, +# | libfix | libfoo >= 1.1.0 +# |-- libfoo-1.0.0.tar.gz +# |-- libfoo-1.1.0.tar.gz +# |-- libfoo-1.2.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature + + # Create the 'stable' repository. + # + cp -r $src/stable $out/stable + $rep_create $out/stable &$out/stable/packages +end + +test.arguments += "config.cxx=$config.cxx" + +pkg_disfigure += -d cfg +pkg_fetch += -d cfg 2>- +pkg_purge += -d cfg +pkg_status += -d cfg +pkg_unpack += -d cfg 2>- +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all 2>- + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-configure' for more information + EOE + +: var-no-name +: +$clone_cfg; +$* "config.dist.root=$~/opt" 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-configure' for more information + EOE + +: unexpected-arg +: +$clone_cfg; +$* libhello libhello 2>>EOE != 0 + error: unexpected argument 'libhello' + EOE + +: fetched +: +{ + +$clone_cfg + +$rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/*** + + : no-such-package + : + $clone_cfg; + $* libhello1 2>>/EOE != 0 + error: package libhello1 does not exist in configuration cfg/ + EOE + + : disfigure + { + : no-name + : + $clone_root_cfg; + $pkg_disfigure 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-disfigure' for more information + EOE + + : no-such-package + : + $clone_root_cfg; + $pkg_disfigure libhello1 2>>/EOE != 0 + error: package libhello1 does not exist in configuration cfg/ + EOE + } + + : wrong-state + : + { + $clone_cfg && $pkg_fetch libhello/1.0.0; + + $* libhello 2>>EOE != 0; + error: package libhello is fetched + info: expected it to be unpacked + EOE + + $pkg_disfigure libhello 2>>EOE != 0; + error: package libhello is fetched + info: expected it to be configured + EOE + + $pkg_purge libhello 2>'purged libhello/1.0.0' + } + + : src-eq-out + : + { + $clone_cfg; + $pkg_fetch libhello/1.0.0 && $pkg_unpack libhello; + + $* libhello 2>'configured libhello/1.0.0'; + $pkg_status libhello 1>'configured 1.0.0; available sys:?'; + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_status libhello 1>'unpacked 1.0.0; available sys:?'; + + $pkg_purge libhello 2>'purged libhello/1.0.0'; + $pkg_status libhello/1.0.0 1>'available' + } +} + +: src-ne-out +: +{ + $clone_cfg && $pkg_unpack -e $src/libhello-1.0.0; + + $* libhello 2>'configured libhello/1.0.0'; + $pkg_status libhello 1>'configured 1.0.0'; + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_status libhello 1>'unpacked 1.0.0'; + + $pkg_purge libhello 2>'purged libhello/1.0.0'; + $pkg_status libhello 1>'unknown'; + test -d cfg/libhello-1.0.0 == 1 +} + +: out-exists-disfigure +: +{ + $clone_cfg && $pkg_unpack -e $src/libhello-1.0.0; + + $* libhello 2>'configured libhello/1.0.0'; + touch cfg/libhello-1.0.0/stray &!cfg/libhello-1.0.0/stray; + + $pkg_disfigure libhello 2>>/EOE != 0; + warning: directory cfg/libhello-1.0.0/ is not empty, not removing + error: package output directory cfg/libhello-1.0.0/ still exists + info: package libhello is now broken; use 'pkg-purge' to remove + EOE + + $pkg_status libhello/1.0.0 >'broken'; + rm -r cfg/libhello-1.0.0; + + $pkg_purge -f libhello 2>'purged libhello/1.0.0'; + $pkg_status libhello/1.0.0 1>'unknown' +} + +: broken +: +if ($cxx.target.class != 'windows') +{ + : disfigure-failed + : + { + $clone_root_cfg && $pkg_unpack -e $src/libhello-1.0.0; + + $* libhello 2>'configured libhello/1.0.0'; + chmod 555 cfg/libhello-1.0.0; + + $pkg_disfigure libhello 2>>/~%EOE% != 0; + %error: unable to remove directory cfg/libhello-1.0.0/.+% + info: package libhello is now broken; use 'pkg-purge' to remove + EOE + + $pkg_status libhello >'broken 1.0.0'; + + chmod 755 cfg/libhello-1.0.0; + rm -r cfg/libhello-1.0.0; + $pkg_purge -f libhello 2>'purged libhello/1.0.0'; + $pkg_status libhello >'unknown' + } + + : configure-failed + : + : Note that pkg-configure in case of build2 process failure implicitly + : performs pkg-disfigure, that succeeds. + : + { + $clone_root_cfg && $pkg_unpack -e $src/libhello-1.0.0; + c = &!cfg/libhello-1.0.0/ &!cfg/libhello-1.0.0/build/; + mkdir -p cfg/libhello-1.0.0/build $c; + chmod 555 cfg/libhello-1.0.0/build; + + $* libhello 2>>/~%EOE% != 0; + %error: unable to create directory cfg/libhello-1.0.0/build/.+% + EOE + + $pkg_status libhello >'unpacked 1.0.0' + } + + : configure-disfigure-failed + : + : Note that pkg-configure in case of build2 process failure implicitly + : performs pkg-disfigure, that also fails. + : + { + $clone_root_cfg && $pkg_unpack -e $src/libhello-1.0.0; + c = &!cfg/libhello-1.0.0/ &!cfg/libhello-1.0.0/build/; + mkdir -p cfg/libhello-1.0.0/build $c; + chmod 555 cfg/libhello-1.0.0 cfg/libhello-1.0.0/build; + + $* libhello 2>>/~%EOE% != 0; + %error: unable to create directory cfg/libhello-1.0.0/build/.+% + %error: unable to remove directory cfg/libhello-1.0.0/build/.+% + info: package libhello is now broken; use 'pkg-purge' to remove + EOE + + $pkg_status libhello >'broken 1.0.0'; + + chmod 755 cfg/libhello-1.0.0 cfg/libhello-1.0.0/build; + rm -r cfg/libhello-1.0.0; + $pkg_purge -f libhello 2>'purged libhello/1.0.0'; + $pkg_status libhello >'unknown' + } +} + +: dependency-management +: +{ + +$clone_cfg && $rep_add $rep/stable && $rep_fetch --trust-yes + + : still-has-deps + : + { + $clone_cfg; + $pkg_fetch libbar/1.0.0 && $pkg_unpack libbar; + + $* libbar 2>>EOE != 0; + error: no configured package satisfies dependency on libfoo + EOE + + $pkg_status libbar/1.0.0 1>'unpacked; available'; + $pkg_fetch libfoo/1.0.0; + $pkg_unpack libfoo; + + $* libbar 2>>EOE != 0; + error: no configured package satisfies dependency on libfoo + EOE + + $* libfoo 2>'configured libfoo/1.0.0'; + $* libbar 2>'configured libbar/1.0.0'; + + $pkg_disfigure libfoo 2>>EOE != 0; + error: package libfoo still has dependencies: + info: package libbar + EOE + + $pkg_disfigure libbar 2>'disfigured libbar/1.0.0'; + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + + $pkg_purge libbar 2>'purged libbar/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : no-package-satisfy + : + { + $clone_cfg; + $pkg_fetch libfoo/1.0.0 && $pkg_unpack libfoo; + + $* libfoo 2>'configured libfoo/1.0.0'; + $pkg_fetch libbar/1.1.0; + $pkg_unpack libbar; + + $* libbar 2>>EOE != 0; + error: no configured package satisfies dependency on libfoo >= 1.1.0 + EOE + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge libfoo 2>'purged libfoo/1.0.0'; + $pkg_fetch libfoo/1.1.0; + $pkg_unpack libfoo; + $* libfoo 2>'configured libfoo/1.1.0'; + $* libbar 2>'configured libbar/1.1.0'; + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0' + } + + : no-package-satisfy-alt + : + { + $clone_cfg; + $pkg_fetch libfoo/1.1.0 && $pkg_unpack libfoo; + + $* libfoo 2>'configured libfoo/1.1.0'; + $pkg_fetch libbar/1.2.0; + $pkg_unpack libbar; + + $* libbar 2>>EOE != 0; + error: no configured package satisfies dependency on libfox | libfoo >= 1.2.0 + EOE + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0'; + $pkg_fetch libfoo/1.2.0; + $pkg_unpack libfoo; + $* libfoo 2>'configured libfoo/1.2.0'; + $* libbar 2>'configured libbar/1.2.0'; + + $pkg_disfigure libfoo 2>>EOE != 0; + error: package libfoo still has dependencies: + info: package libbar on libfoo >= 1.2.0 + EOE + + $pkg_disfigure libbar 2>'disfigured libbar/1.2.0'; + $pkg_disfigure libfoo 2>'disfigured libfoo/1.2.0'; + + $pkg_purge libfoo 2>'purged libfoo/1.2.0'; + $pkg_purge libbar 2>'purged libbar/1.2.0' + } + + : incompatible-constraints + : + { + $clone_cfg; + $pkg_fetch libfoo/1.1.0 && $pkg_unpack libfoo; + + $* libfoo 2>'configured libfoo/1.1.0'; + $pkg_fetch libbar/1.3.0; + $pkg_unpack libbar; + + $* libbar 2>>EOE != 0; + error: multiple dependencies on package libfoo + info: libfoo <= 1.1.0 + info: libfoo >= 1.1.0 + EOE + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.3.0' + } +} diff --git a/tests/pkg-configure/hello b/tests/pkg-configure/hello new file mode 120000 index 0000000..9312ba9 --- /dev/null +++ b/tests/pkg-configure/hello @@ -0,0 +1 @@ +../common/hello/ \ No newline at end of file diff --git a/tests/pkg-configure/libhello-1.0.0 b/tests/pkg-configure/libhello-1.0.0 new file mode 120000 index 0000000..a6f638b --- /dev/null +++ b/tests/pkg-configure/libhello-1.0.0 @@ -0,0 +1 @@ +../common/libhello-1.0.0 \ No newline at end of file diff --git a/tests/pkg-configure/stable/libbar-1.0.0.tar.gz b/tests/pkg-configure/stable/libbar-1.0.0.tar.gz new file mode 100644 index 0000000..0ae6e26 Binary files /dev/null and b/tests/pkg-configure/stable/libbar-1.0.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libbar-1.1.0.tar.gz b/tests/pkg-configure/stable/libbar-1.1.0.tar.gz new file mode 100644 index 0000000..39dbdf4 Binary files /dev/null and b/tests/pkg-configure/stable/libbar-1.1.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libbar-1.2.0.tar.gz b/tests/pkg-configure/stable/libbar-1.2.0.tar.gz new file mode 100644 index 0000000..3a034ff Binary files /dev/null and b/tests/pkg-configure/stable/libbar-1.2.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libbar-1.3.0.tar.gz b/tests/pkg-configure/stable/libbar-1.3.0.tar.gz new file mode 100644 index 0000000..19d5a6f Binary files /dev/null and b/tests/pkg-configure/stable/libbar-1.3.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libfoo-1.0.0.tar.gz b/tests/pkg-configure/stable/libfoo-1.0.0.tar.gz new file mode 100644 index 0000000..28a6a90 Binary files /dev/null and b/tests/pkg-configure/stable/libfoo-1.0.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libfoo-1.1.0.tar.gz b/tests/pkg-configure/stable/libfoo-1.1.0.tar.gz new file mode 100644 index 0000000..e03481f Binary files /dev/null and b/tests/pkg-configure/stable/libfoo-1.1.0.tar.gz differ diff --git a/tests/pkg-configure/stable/libfoo-1.2.0.tar.gz b/tests/pkg-configure/stable/libfoo-1.2.0.tar.gz new file mode 100644 index 0000000..aad6906 Binary files /dev/null and b/tests/pkg-configure/stable/libfoo-1.2.0.tar.gz differ diff --git a/tests/pkg-configure/stable/repositories b/tests/pkg-configure/stable/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg-configure/stable/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/pkg-drop.test b/tests/pkg-drop.test new file mode 100644 index 0000000..500d611 --- /dev/null +++ b/tests/pkg-drop.test @@ -0,0 +1,448 @@ +# file : tests/pkg-drop.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test remote.test + +# Source repository: +# +# pkg-drop +# |-- t4a +# | |-- libfoo-1.1.0.tar.gz +# | `-- repositories +# |-- t4b -> t4a (prerequisite) +# | |-- libbar-1.1.0.tar.gz -> libfoo == 1.1.0 +# | `-- repositories +# |-- t4c -> t4b (prerequisite) +# | |-- libbaz-1.1.0.tar.gz -> libfoo, libbar +# | |-- libfoo-1.0.0.tar.gz +# | `-- repositories +# `-- t4d -> t4c (prerequisite) +# |-- libbiz-1.0.0.tar.gz -> libfox, libfoo, libbaz +# |-- libfox-1.0.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + cp -r $src/t4a $out/t4a && $rep_create $out/t4a &$out/t4a/packages + cp -r $src/t4b $out/t4b && $rep_create $out/t4b &$out/t4b/packages + cp -r $src/t4c $out/t4c && $rep_create $out/t4c &$out/t4c/packages + cp -r $src/t4d $out/t4d && $rep_create $out/t4d &$out/t4d/packages +end + +pkg_build += -d cfg --yes 2>- +pkg_status += -d cfg +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all --trust-yes 2>- + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-drop' for more information + EOE + +: unknown-package +: +$clone_cfg; +$* libfoo 2>>/EOE != 0 + error: package libfoo does not exist in configuration cfg/ + EOE + +: unknown-package-ver +: +$clone_cfg; +$* libfoo/1.0.0 2>>~%EOE% != 0 + %error: package libfoo/1.0.0 does not exist in configuration cfg[/\\]% + EOE + +: prerequisites-or-dependents +: +{ + +$clone_cfg && $rep_add $rep/t4c && $rep_fetch + +$pkg_build libbaz + + test.arguments += --print-only + + : foo-baz-bar + : + $clone_cfg; + $* -y libfoo libbaz libbar >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + + : dependents + : + { + # Prepare the nested tests to use configuration from the enclosing + # 'prerequisites-or-dependents' group scope. + # + clone_cfg = cp -r $~/../cfg ./ + + : unconfirmed + : + { + test.arguments += --yes + + : libfoo + : + $clone_cfg; + $* libfoo 2>>EOE != 0 + following dependent packages will have to be dropped as well: + libbar (requires libfoo) + libbaz (requires libbar) + error: refusing to drop dependent packages with just --yes + info: specify --drop-dependent to confirm + EOE + + : libfoo-libbar + : + $clone_cfg; + $* libfoo libbar 2>>EOE != 0 + following dependent packages will have to be dropped as well: + libbaz (requires libbar) + error: refusing to drop dependent packages with just --yes + info: specify --drop-dependent to confirm + EOE + + : libfoo-libbaz + : + $clone_cfg; + $* libfoo libbaz 2>>EOE != 0 + following dependent packages will have to be dropped as well: + libbar (requires libfoo) + error: refusing to drop dependent packages with just --yes + info: specify --drop-dependent to confirm + EOE + } + + : confirmed + : + { + test.arguments += --drop-dependent + + : libfoo + : + $clone_cfg; + $* libfoo >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + + : libfoo-libbaz + : + $clone_cfg; + $* libfoo libbaz >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + + : libbaz-libfoo + : + $clone_cfg; + $* libbaz libfoo >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + } + } + + : prerequisites + : + { + # Prepare the nested tests to use configuration from the enclosing + # 'prerequisites-or-dependents' group scope. + # + clone_cfg = cp -r $~/../cfg ./ + + : libbaz + : + $clone_cfg; + $* -y libbaz >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + + : libbaz-only + : + $clone_cfg; + $* -n libbaz >>EOO + drop libbaz + EOO + + : libbar-libbaz + : + $clone_cfg; + $* -n libbar libbaz >>EOO + drop libbaz + drop libbar + EOO + + : libbaz-libbar + : + $clone_cfg; + $* -n libbaz libbar >>EOO + drop libbaz + drop libbar + EOO + + : dependencies + : + : Note that we don't move this test to the prerequisites-and-dependents + : group as the configuration repository set would be different. + : + $clone_cfg; + $* -y --drop-dependent libbar >>EOO + drop libbaz + drop libbar + drop libfoo + EOO + } + + # Here we combine the test group teardown and the "actual drop" test. + # + -$pkg_drop -d cfg --yes libbaz 2>>EOE + disfigured libbaz + disfigured libbar + disfigured libfoo + purged libbaz + purged libbar + purged libfoo + EOE + + -$pkg_status libbar/1.1.0 >'unknown' + -$pkg_status libbaz/1.1.0 >'available' + -$pkg_status libfoo/1.1.0 >'available' +} + +: prerequisites-and-dependents +: +{ + +$clone_cfg && $rep_add $rep/t4d && $rep_fetch + +$pkg_build libbiz + + clone_cfg = cp -r ../../cfg ./ + test.arguments += --print-only + + : drop-prerequisites-no-dependents + : + { + test.arguments += --yes + + : libbiz + : + $clone_cfg; + $* libbiz >>EOO + drop libbiz + drop libbaz + drop libbar + drop libfoo + drop libfox + EOO + + : libfox-libbiz + : + $clone_cfg; + $* libfox libbiz >>EOO + drop libbiz + drop libfox + drop libbaz + drop libbar + drop libfoo + EOO + } + + : drop-prerequisites + : + { + test.arguments += --yes --drop-dependent + + : libfox + : + $clone_cfg; + $* libfox >>EOO + drop libbiz + drop libfox + drop libbaz + drop libbar + drop libfoo + EOO + + : libbaz + : + $clone_cfg; + $* libbaz >>EOO + drop libbiz + drop libbaz + drop libbar + drop libfoo + drop libfox + EOO + + : libbar + : + $clone_cfg; + $* libbar >>EOO + drop libbiz + drop libbaz + drop libbar + drop libfoo + drop libfox + EOO + + : libfoo + : + $clone_cfg; + $* libfoo >>EOO + drop libbiz + drop libbaz + drop libbar + drop libfoo + drop libfox + EOO + } + + : keep-prerequisites + { + test.arguments += --no --drop-dependent + + : fox-baz + : + $clone_cfg; + $* libfox libbaz >>EOO + drop libbiz + drop libfox + drop libbaz + EOO + + : libbaz-libfox + : + $clone_cfg; + $* libbaz libfox >>EOO + drop libbiz + drop libbaz + drop libfox + EOO + + : libfox-libbar + : + $clone_cfg; + $* libfox libbar >>EOO + drop libbiz + drop libfox + drop libbaz + drop libbar + EOO + + : libbar-libfox + : + $clone_cfg; + $* libbar libfox >>EOO + drop libbiz + drop libbaz + drop libbar + drop libfox + EOO + } + + -$pkg_drop -d cfg --yes --drop-dependent libbar 2>>EOE + disfigured libbiz + disfigured libbaz + disfigured libbar + disfigured libfoo + disfigured libfox + purged libbiz + purged libbaz + purged libbar + purged libfoo + purged libfox + EOE + + -$pkg_status libfox/1.0.0 >'available' + -$pkg_status libfoo/1.1.0 >'unknown' + -$pkg_status libbar/1.1.0 >'unknown' + -$pkg_status libbaz/1.1.0 >'unknown' + -$pkg_status libbiz/1.0.0 >'available' +} + +: keep-drop-options +: +: Test --drop-dependent, --keep-dependent, --drop-prerequisite, +: --keep-prerequisite option. +: +{ + +$clone_cfg && $rep_add $rep/t4b && $rep_fetch + + : keep-drop-dependent + : + { + $clone_cfg && $pkg_build libbar; + + $* --keep-dependent libfoo 2>>EOE != 0; + error: following dependent packages will have to be dropped as well: + libbar (requires libfoo) + EOE + + $* --drop-dependent libfoo 2>>EOE + disfigured libbar + disfigured libfoo + purged libbar + purged libfoo + EOE + } + + : drop-prerequisite + : + { + $clone_cfg && $pkg_build libbar; + + $* --drop-prerequisite libbar 2>>EOE + disfigured libbar + disfigured libfoo + purged libbar + purged libfoo + EOE + } + + : keep-prerequisite + : + { + $clone_cfg && $pkg_build libbar; + + $* --keep-prerequisite libbar 2>>EOE; + disfigured libbar + purged libbar + EOE + + $pkg_status libfoo >'configured 1.1.0'; + + $* libfoo 2>>EOE + disfigured libfoo + purged libfoo + EOE + } +} + +: disfigure-only +: +: Test --disfigure-only option. +: +{ + $clone_cfg && $rep_add $rep/t4a && $rep_fetch; + $pkg_build libfoo; + + $* --disfigure-only libfoo 2>'disfigured libfoo'; + $pkg_status libfoo >'unpacked 1.1.0 hold_package; available sys:?'; + + $* libfoo 2>'purged libfoo' +} diff --git a/tests/pkg-drop/t4a b/tests/pkg-drop/t4a new file mode 120000 index 0000000..47997b2 --- /dev/null +++ b/tests/pkg-drop/t4a @@ -0,0 +1 @@ +../common/satisfy/t4a \ No newline at end of file diff --git a/tests/pkg-drop/t4b b/tests/pkg-drop/t4b new file mode 120000 index 0000000..917299c --- /dev/null +++ b/tests/pkg-drop/t4b @@ -0,0 +1 @@ +../common/satisfy/t4b \ No newline at end of file diff --git a/tests/pkg-drop/t4c b/tests/pkg-drop/t4c new file mode 120000 index 0000000..06b7611 --- /dev/null +++ b/tests/pkg-drop/t4c @@ -0,0 +1 @@ +../common/satisfy/t4c \ No newline at end of file diff --git a/tests/pkg-drop/t4d b/tests/pkg-drop/t4d new file mode 120000 index 0000000..56dc0f7 --- /dev/null +++ b/tests/pkg-drop/t4d @@ -0,0 +1 @@ +../common/satisfy/t4d \ No newline at end of file diff --git a/tests/pkg-fetch.test b/tests/pkg-fetch.test new file mode 100644 index 0000000..6689d3d --- /dev/null +++ b/tests/pkg-fetch.test @@ -0,0 +1,200 @@ +# file : tests/pkg-fetch.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# pkg-fetch +# |-- hello +# | |-- libhello-1.0.0.tar.gz +# | `-- repositories +# `-- t1 +# |-- libfoo-1.0.0.tar.gz +# |-- libfoo-1.1.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature + + # Create the 't1' repository. + # + cp -r $src/t1 $out/t1 && $rep_create $out/t1 &$out/t1/packages +end + +pkg_purge += -d cfg +pkg_status += -d cfg +pkg_unpack += -d cfg +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all 2>- + +: no-archive +: +$clone_cfg; +$* -e 2>>EOE != 0 + error: archive path argument expected + info: run 'bpkg help pkg-fetch' for more information + EOE + +: archive-not-exist +: +$clone_cfg; +$* -e ./no-such-file 2>>/EOE != 0 + error: archive file './no-such-file' does not exist + EOE + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name/version argument expected + info: run 'bpkg help pkg-fetch' for more information + EOE + +: no-version +: +$clone_cfg; +$* libfoo 2>>EOE != 0 + error: package version expected + info: run 'bpkg help pkg-fetch' for more information + EOE + +: invalid-version +: +$clone_cfg; +$* libfoo/1/2/3 2>>EOE != 0 + error: invalid package version '1/2/3': alpha-numeric characters expected in a component + EOE + +: no-repositories +: +$clone_cfg; +$* libfoo/1.0.0 2>>/EOE != 0 + error: configuration cfg/ has no repositories + info: use 'bpkg rep-add' to add a repository + EOE + +: no-packages +: +{ + $clone_cfg && $rep_add $rep/t1; + + $* libfoo/1.0.0 2>>/EOE != 0 + error: configuration cfg/ has no available packages + info: use 'bpkg rep-fetch' to fetch available packages list + EOE +} + +# Note that when we fetch a package from remote repository the bpkg stderr +# contains fetch program progress output, that comes prior the informational +# message. +# + +: fetched-rep +: +{ + +$clone_cfg && $rep_add $rep/t1 && $rep_fetch --trust-yes + + : package-not-available + : + $clone_cfg; + $* libfoo/2.0.0+1 2>>/EOE != 0 + error: package libfoo 2.0.0+1 is not available + EOE + + : package-available + : + { + $clone_cfg; + + $* libfoo/1.0.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.0.0% + EOE + + $pkg_status libfoo/1.0.0 1>'fetched; available'; + + $* libfoo/1.0.0 2>>/EOE != 0; + error: package libfoo already exists in configuration cfg/ + info: version: 1.0.0, state: fetched, substate: none + info: use 'pkg-fetch --replace|-r' to replace + EOE + + $* -e $src/t1/libfoo-1.0.0.tar.gz 2>>/EOE != 0; + error: package libfoo already exists in configuration cfg/ + info: version: 1.0.0, state: fetched, substate: none + info: use 'pkg-fetch --replace|-r' to replace + EOE + + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : package-replace + : + { + $clone_cfg; + + $* -e $src/t1/libfoo-1.0.0.tar.gz 2>'fetched libfoo/1.0.0'; + $pkg_status libfoo/1.0.0 1>'fetched; available'; + $pkg_unpack libfoo 2>'unpacked libfoo/1.0.0'; + + test.arguments += --replace; # Replace existing package. + + $* libfoo/1.1.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.1.0% + EOE + + $pkg_status libfoo/1.1.0 1>'fetched; available'; + $pkg_unpack libfoo 2>'unpacked libfoo/1.1.0'; + $* -e $src/t1/libfoo-1.0.0.tar.gz 2>'fetched libfoo/1.0.0'; + $pkg_status libfoo/1.0.0 1>'fetched; available'; + + $* libfoo/1.1.0 2>>~%EOE%; + %.* + %.*fetched libfoo/1.1.0% + EOE + + $pkg_status libfoo/1.1.0 1>'fetched; available'; + $* -e $src/t1/libfoo-1.0.0.tar.gz 2>'fetched libfoo/1.0.0'; + $pkg_status libfoo/1.0.0 1>'fetched; available'; + + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : purge-existing + : + { + $clone_cfg; + cp $src/t1/libfoo-1.0.0.tar.gz ./ &!libfoo-1.0.0.tar.gz; + + $* -p -e libfoo-1.0.0.tar.gz 2>'fetched libfoo/1.0.0'; + + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } +} + +: hello +: +{ + $clone_cfg; + $rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/***; + + $* libhello/1.0.0 2>>~%EOE%; + %.* + %.*fetched libhello/1.0.0% + EOE + + $pkg_status libhello/1.0.0 1>'fetched; available'; + + $pkg_purge libhello 2>'purged libhello/1.0.0' +} diff --git a/tests/pkg-fetch/hello b/tests/pkg-fetch/hello new file mode 120000 index 0000000..e10a7f8 --- /dev/null +++ b/tests/pkg-fetch/hello @@ -0,0 +1 @@ +../common/hello \ No newline at end of file diff --git a/tests/pkg-fetch/t1 b/tests/pkg-fetch/t1 new file mode 120000 index 0000000..a27d298 --- /dev/null +++ b/tests/pkg-fetch/t1 @@ -0,0 +1 @@ +../common/t1 \ No newline at end of file diff --git a/tests/pkg-purge.test b/tests/pkg-purge.test new file mode 100644 index 0000000..0f7b256 --- /dev/null +++ b/tests/pkg-purge.test @@ -0,0 +1,182 @@ +# file : tests/pkg-purge.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test + +# Source repository: +# +# pkg-purge +# |-- libfoo-1.0.0.tar.gz +# `-- libfoo-1.1.0 -> +# |-- build +# | `-- bootstrap.build +# |-- buildfile +# `-- manifest + +pkg_fetch += -d cfg 2>- +pkg_unpack += -d cfg 2>- +pkg_status += -d cfg + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-purge' for more information + EOE + +: no-package +: +$clone_cfg; +$* libfoo 2>>/EOE != 0 + error: package libfoo does not exist in configuration cfg/ + EOE + +: fetched +: +{ + $clone_cfg && $pkg_fetch -e $src/libfoo-1.0.0.tar.gz; + + $* libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo 1>'unknown' +} + +: keep +: +{ + $clone_cfg && $pkg_fetch -e $src/libfoo-1.0.0.tar.gz; + + $* -k libfoo 2>'keeping archive libfoo/1.0.0'; + $pkg_status libfoo 1>'fetched 1.0.0'; + $* libfoo 2>'purged libfoo/1.0.0' +} + +: purge-archive +: +{ + $clone_cfg; + cp $src/libfoo-1.0.0.tar.gz cfg/ &!cfg/libfoo-1.0.0.tar.gz; + $pkg_fetch -e -p cfg/libfoo-1.0.0.tar.gz; + + $* libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo 1>'unknown'; + test -f cfg/libfoo-1.0.0.tar.gz == 1 +} + +: no-archive-keep +: +{ + $clone_cfg && $pkg_unpack -e $src/libfoo-1.1.0; + + $* --keep libfoo 2>>EOE != 0; + error: package libfoo has no archive to keep + EOE + + $pkg_status libfoo 1>'unpacked 1.1.0'; + $* libfoo 2>'purged libfoo/1.1.0' +} + +: unpacked-dir +: +{ + $clone_cfg && $pkg_unpack -e $src/libfoo-1.1.0; + + $* libfoo 2>'purged libfoo/1.1.0'; + $pkg_status libfoo 1>'unknown' +} + +: unpacked-archive +: +{ + $clone_cfg; + $pkg_fetch -e $src/libfoo-1.0.0.tar.gz && $pkg_unpack libfoo; + + $* libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo 1>'unknown'; + test -d cfg/libfoo-1.0.0 == 1 +} + +: keep-unpacked-archive +: +{ + $clone_cfg; + $pkg_fetch -e $src/libfoo-1.0.0.tar.gz && $pkg_unpack libfoo; + + $* --keep libfoo 2>'keeping archive libfoo/1.0.0'; + $pkg_status libfoo 1>'fetched 1.0.0'; + test -d cfg/libfoo-1.0.0 == 1; + $* libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo 1>'unknown' +} + +: purge-dir +: +{ + $clone_cfg; + + # @@ Use --no-cleanup for cp builtin when implemented. + # + d = &!cfg/libfoo-1.1.0/; + c = $d/ $d/build/ $d/build/bootstrap.build $d/buildfile $d/manifest; + cp -r $src/libfoo-1.1.0 cfg/ $c; + + $pkg_unpack -e -p cfg/libfoo-1.1.0; + + $* libfoo 2>'purged libfoo/1.1.0'; + $pkg_status libfoo 1>'unknown'; + test -d cfg/libfoo-1.1.0 == 1 +} + +: purge-unpacked-archive +: +{ + $clone_cfg; + cp $src/libfoo-1.0.0.tar.gz cfg/ &!cfg/libfoo-1.0.0.tar.gz; + $pkg_fetch -e -p cfg/libfoo-1.0.0.tar.gz && $pkg_unpack libfoo; + + $* libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo 1>'unknown'; + test -d cfg/libfoo-1.0.0 == 1; + test -f cfg/libfoo-1.0.0.tar.gz == 1 +} + +: broken +: +if ($cxx.target.class != 'windows') +{ + $clone_cfg; + cp $src/libfoo-1.0.0.tar.gz cfg/ &!cfg/libfoo-1.0.0.tar.gz; + $pkg_fetch -e -p cfg/libfoo-1.0.0.tar.gz; + $pkg_unpack libfoo; + chmod 000 cfg/libfoo-1.0.0; + + $* libfoo 2>>/~%EOE% != 0; + %error: unable to remove directory cfg/libfoo-1.0.0/.+% + info: package libfoo is now broken; use 'pkg-purge --force' to remove + EOE + + $pkg_status libfoo/1.0.0 >'broken'; + + $* -f -k libfoo 2>'error: cannot keep broken package libfoo' != 0; + $pkg_status libfoo/1.0.0 >'broken'; + + $* -f libfoo 2>>/EOE != 0; + error: source directory of broken package libfoo still exists + info: remove cfg/libfoo-1.0.0/ manually then re-run pkg-purge + EOE + + $pkg_status libfoo/1.0.0 >'broken'; + + chmod 755 cfg/libfoo-1.0.0; + rm -r cfg/libfoo-1.0.0; + + $* -f libfoo 2>>/EOE != 0; + error: archive file of broken package libfoo still exists + info: remove cfg/libfoo-1.0.0.tar.gz manually then re-run pkg-purge + EOE + + rm cfg/libfoo-1.0.0.tar.gz; + $* -f libfoo 2>'purged libfoo/1.0.0'; + $pkg_status libfoo >'unknown' +} diff --git a/tests/pkg-purge/libfoo-1.0.0.tar.gz b/tests/pkg-purge/libfoo-1.0.0.tar.gz new file mode 120000 index 0000000..85fcfba --- /dev/null +++ b/tests/pkg-purge/libfoo-1.0.0.tar.gz @@ -0,0 +1 @@ +../common/t1/libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg-purge/libfoo-1.1.0 b/tests/pkg-purge/libfoo-1.1.0 new file mode 120000 index 0000000..15fcf5c --- /dev/null +++ b/tests/pkg-purge/libfoo-1.1.0 @@ -0,0 +1 @@ +../common/libfoo-1.1.0 \ No newline at end of file diff --git a/tests/pkg-status.test b/tests/pkg-status.test new file mode 100644 index 0000000..ff7cab7 --- /dev/null +++ b/tests/pkg-status.test @@ -0,0 +1,160 @@ +# file : tests/pkg-status.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test remote.test + +# Source repository: +# +# pkg-status +# |-- extra -> stable (prerequisite) +# | |-- libbar-1.1.0+1.tar.gz +# | `-- repositories +# |-- stable +# | |-- libbar-1.0.0.tar.gz +# | |-- libfoo-1.0.0.tar.gz +# | `-- repositories +# |-- testing -> stable (complement), extra (prerequisite) +# | |-- libbar-1.0.0+1.tar.gz +# | |-- libbar-1.1.0.tar.gz +# | `-- repositories +# `-- unstable -> testing (complement) +# |-- libbar-2.0.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + c = $rep_create 2>- + + cp -r $src/extra $out/extra && $c $out/extra &$out/extra/packages + cp -r $src/stable $out/stable && $c $out/stable &$out/stable/packages + cp -r $src/testing $out/testing && $c $out/testing &$out/testing/packages + cp -r $src/unstable $out/unstable && $c $out/unstable &$out/unstable/packages +end + +pkg_fetch += 2>- +pkg_purge += -d cfg 2>- +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all --trust-yes 2>- + +: basics +: +{ + +$clone_cfg + + : not-fetched + : + { + +$clone_cfg + + : libfoo-1.0.0 + : + $clone_cfg; + $* libfoo/1.0.0 >'unknown' + + : libfoo + : + $clone_cfg; + $* libfoo >'unknown' + } + + : rep-fetched + : + { + +$clone_cfg && $rep_add $rep/stable && $rep_fetch + + +cp -r cfg ./fetched + +$pkg_fetch libfoo/1.0.0 -d fetched &fetched/libfoo-1.0.0.tar.gz + + : libfoo-1.0.0 + : + $clone_cfg; + $* libfoo/1.0.0 >'available' + + : libfoo + : + $clone_cfg; + $* libfoo >'available 1.0.0 sys:?' + + : pkg-fetched + : + { + clone_cfg = cp -r ../../fetched cfg + + : libfoo-1.0.0 + : + $clone_cfg; + $* libfoo/1.0.0 >'fetched; available' + + : libfoo + : + $clone_cfg; + $* libfoo >'fetched 1.0.0; available sys:?' + } + } +} + +: multiple-versions +{ + # Prepare the nested tests to copy the root configuration. Note that they + # must provide the destination directory name as an argument. + # + clone_cfg = cp -r $~/../cfg + + : extra + : + { + # Here we, first, prepare 2 configurations that derive from each other, and + # then spawn 2 tests on them. + # + +$clone_cfg extra && $rep_add -d extra $rep/extra && $rep_fetch -d extra + + +cp -r extra extra-stable + +$rep_add -d extra-stable $rep/stable && $rep_fetch -d extra-stable + + : libbar + : + $* -d ../extra libbar >'available 1.1.0+1 sys:?' + + : libbar-stable + : + $* -d ../extra-stable libbar >'available 1.1.0+1 1.0.0 sys:?' + } + + : testing + : + { + $clone_cfg ./ && $rep_add $rep/testing && $rep_fetch; + + $* libbar >'available 1.1.0 1.0.0+1 1.0.0 sys:?' + } + + : unstable + : + { + # Here we, first, prepare 3 configurations that derive from each other, and + # then spawn 3 tests on them. + # + +$clone_cfg ./ && $rep_add $rep/unstable && $rep_fetch + + +cp -r cfg fetched1 + +$pkg_fetch libbar/1.0.0+1 -d fetched1 &fetched1/libbar-1.0.0+1.tar.gz + + +cp -r fetched1 fetched2 + +$pkg_purge -d fetched2 libbar &!fetched2/libbar-1.0.0+1.tar.gz + +$pkg_fetch libbar/2.0.0 -d fetched2 &fetched2/libbar-2.0.0.tar.gz + + : not-fetched + : + $* -d ../cfg libbar >'available 2.0.0 1.1.0 1.0.0+1 1.0.0 sys:?' + + : fetched-1 + : + $* -d ../fetched1 libbar >'fetched 1.0.0+1; available 2.0.0 1.1.0 sys:?' + + : fetched-2 + : + $* -d ../fetched2 libbar >'fetched 2.0.0; available sys:?' + } +} diff --git a/tests/pkg-status/extra/libbar-1.1.0+1.tar.gz b/tests/pkg-status/extra/libbar-1.1.0+1.tar.gz new file mode 100644 index 0000000..890e9e2 Binary files /dev/null and b/tests/pkg-status/extra/libbar-1.1.0+1.tar.gz differ diff --git a/tests/pkg-status/extra/repositories b/tests/pkg-status/extra/repositories new file mode 100644 index 0000000..ecaa454 --- /dev/null +++ b/tests/pkg-status/extra/repositories @@ -0,0 +1,3 @@ +: 1 +location: ../stable +: diff --git a/tests/pkg-status/stable/libbar-1.0.0.tar.gz b/tests/pkg-status/stable/libbar-1.0.0.tar.gz new file mode 100644 index 0000000..97e6e32 Binary files /dev/null and b/tests/pkg-status/stable/libbar-1.0.0.tar.gz differ diff --git a/tests/pkg-status/stable/libfoo-1.0.0.tar.gz b/tests/pkg-status/stable/libfoo-1.0.0.tar.gz new file mode 100644 index 0000000..5e7fa17 Binary files /dev/null and b/tests/pkg-status/stable/libfoo-1.0.0.tar.gz differ diff --git a/tests/pkg-status/stable/repositories b/tests/pkg-status/stable/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg-status/stable/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/pkg-status/testing/libbar-1.0.0+1.tar.gz b/tests/pkg-status/testing/libbar-1.0.0+1.tar.gz new file mode 100644 index 0000000..5794085 Binary files /dev/null and b/tests/pkg-status/testing/libbar-1.0.0+1.tar.gz differ diff --git a/tests/pkg-status/testing/libbar-1.1.0.tar.gz b/tests/pkg-status/testing/libbar-1.1.0.tar.gz new file mode 100644 index 0000000..b01ac44 Binary files /dev/null and b/tests/pkg-status/testing/libbar-1.1.0.tar.gz differ diff --git a/tests/pkg-status/testing/repositories b/tests/pkg-status/testing/repositories new file mode 100644 index 0000000..7bd7269 --- /dev/null +++ b/tests/pkg-status/testing/repositories @@ -0,0 +1,6 @@ +: 1 +location: ../stable +role: complement +: +location: ../extra +: diff --git a/tests/pkg-status/unstable/libbar-2.0.0.tar.gz b/tests/pkg-status/unstable/libbar-2.0.0.tar.gz new file mode 100644 index 0000000..6cc5890 Binary files /dev/null and b/tests/pkg-status/unstable/libbar-2.0.0.tar.gz differ diff --git a/tests/pkg-status/unstable/repositories b/tests/pkg-status/unstable/repositories new file mode 100644 index 0000000..8f4a5f6 --- /dev/null +++ b/tests/pkg-status/unstable/repositories @@ -0,0 +1,4 @@ +: 1 +location: ../testing +role: complement +: diff --git a/tests/pkg-system.test b/tests/pkg-system.test new file mode 100644 index 0000000..e8210f6 --- /dev/null +++ b/tests/pkg-system.test @@ -0,0 +1,873 @@ +# file : tests/pkg-system.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# There is no pkg-system command, and this testscript contains tests for +# various building scenarios that involves system packages. Note that by that +# reason usage of $* is meaningless. +# + +# Source repository: +# +# pkg-system +# |-- foo-2.tar.gz -> libbar >= 2 +# |-- libbar-0+1.tar.gz +# |-- libbar-1.tar.gz -> libbaz == 2 +# |-- libbar-2.tar.gz -> libbaz == 2 +# |-- libbaz-2.tar.gz +# |-- t1 +# | |-- foo-2.tar.gz -> libbar >= 2 +# | |-- libbar-1.tar.gz -> libbaz == 2 +# | |-- libbar-2.tar.gz -> libbaz == 2 +# | |-- libbaz-2.tar.gz +# | `-- repositories +# |-- t2 +# | |-- foo-2.tar.gz -> libbar >= 2 +# | |-- libbar-0+1.tar.gz +# | `-- repositories +# `-- t3 -> t2 (prerequisite) +# |-- foo-2.tar.gz -> libbar >= 2 +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + cp -r $src/t1 $out/t1 && $rep_create $out/t1 &$out/t1/packages + cp -r $src/t2 $out/t2 && $rep_create $out/t2 &$out/t2/packages + cp -r $src/t3 $out/t3 && $rep_create $out/t3 &$out/t3/packages +end + +pkg_build += -d cfg --yes +pkg_drop += -d cfg --yes 2>- +pkg_status += -d cfg +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all --trust-yes 2>- + +# Note that when we fetch a package from remote repository the bpkg stderr +# contains fetch program progress output, that comes prior the informational +# message. +# + +: t1 +: +{ + +$clone_cfg && $rep_add $rep/t1 && $rep_fetch + + : dup + : + : Test that passing package duplicates on the command line expectedly fails. + : Note that we unite all such tests into a single one for the sake of code + : (and not to think of too many ids for almost identical tests :-)). + : + { + $clone_cfg; + + $pkg_build 'sys:libbar' '?sys:libbar' 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as ?sys:libbar + info: second mentioned as sys:libbar + EOE + + $pkg_build '?sys:libbar' 'sys:libbar' 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as ?sys:libbar + info: second mentioned as sys:libbar + EOE + + $pkg_build '?sys:libbar' libbar 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as ?sys:libbar + info: second mentioned as libbar + EOE + + $pkg_build libbar '?sys:libbar' 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as ?sys:libbar + info: second mentioned as libbar + EOE + + $pkg_build 'sys:libbar' libbar 2>>EOE != 0; + error: duplicate package libbar + info: first mentioned as sys:libbar + info: second mentioned as libbar + EOE + + $pkg_build libbar 'sys:libbar' 2>>EOE != 0 + error: duplicate package libbar + info: first mentioned as libbar + info: second mentioned as sys:libbar + EOE + } + + : syslibbar-foo-syslibbar2-libbar2 + : + : The overall plan is to build sys:libbar/*, foo, then reconfigure + : sys:libbar/* to sys:libbar/2 and afterwards to libbar/2. + : + { + $clone_cfg; + + # Build sys:libbar/*. + # + $pkg_build 'sys:libbar' 2>'configured sys:libbar/*'; + $pkg_status libbar 1>'configured,system * hold_package hold_version; available 2 1 sys:?'; + $pkg_status libbaz 1>'available 2 sys:?'; + + # Build foo with preconfigured sys:libbar/*. + # + $pkg_build foo 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system * hold_package hold_version; available 2 1 sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + # Reconfigure sys:libbar/* to 2. + # + $pkg_build 'sys:libbar/2' 2>>~%EOE%; + disfigured foo/2 + purged libbar/* + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + # Reconfigure sys:libbar/2 to libbar/2. + # + $pkg_build libbar/2 2>>~%EOE%; + disfigured foo/2 + purged libbar/2 + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + configured libbaz/2 + configured libbar/2 + configured foo/2 + %info: .+ is up to date% + %info: .+ is up to date% + updated libbar/2 + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + $pkg_drop foo libbar + } + + : foo-syslibbar2 + : + : Build foo and sys:libbar/2. + : + { + $clone_cfg; + + $pkg_build foo 'sys:libbar/2' 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } + + : syslibbar2-foo + : + : Build sys:libbar/2 and foo. + : + { + $clone_cfg; + + $pkg_build 'sys:libbar/2' foo 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } + + : libbar2-foo-syslibbar2 + : + : The overall plan is to build libbar/2, then foo and sys:libbar/2. + : + { + $clone_cfg; + + # Build libbar/2. + # + $pkg_build libbar/2 2>>~%EOE%; + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + configured libbaz/2 + configured libbar/2 + %info: .+ is up to date% + updated libbar/2 + EOE + + $pkg_status libbar >'configured 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + # Build foo and sys:libbar/2. + # + $pkg_build foo 'sys:libbar/2' 2>>~%EOE%; + disfigured libbar/2 + purged libbar/2 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + disfigured libbaz + purged libbaz + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } + + : libbar2-foo-syslibbar + : + : The overall plan is to build libbar/2, then foo and sys:libbar. + : + { + $clone_cfg; + + # Build libbar/2. + # + $pkg_build libbar/2 2>>~%EOE%; + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + configured libbaz/2 + configured libbar/2 + %info: .+ is up to date% + updated libbar/2 + EOE + + $pkg_status libbar >'configured 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + # Build foo and sys:libbar. + # + $pkg_build foo 'sys:libbar' 2>>~%EOE%; + disfigured libbar/2 + purged libbar/2 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/* + configured foo/2 + disfigured libbaz + purged libbaz + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system * hold_package hold_version; available 2 1 sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } + + : syslibbar2-foo-libbar2-syslibbar2-libbar2 + : + : The overall plan is to build sys:libbar/2, then foo and libbar/2, then + : reconfigure to sys:libbar/2 and afterwards to libbar/2. + : + { + $clone_cfg; + + # Build sys:libbar/2. + # + $pkg_build 'sys:libbar/2' 2>'configured sys:libbar/2'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + + # Build foo and libbar/2. + # + $pkg_build foo libbar/2 2>>~%EOE%; + purged libbar/2 + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured libbaz/2 + configured libbar/2 + configured foo/2 + %info: .+ is up to date% + %info: .+ is up to date% + updated libbar/2 + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + # Build sys:libbar/2. + # + $pkg_build 'sys:libbar/2' 2>>~%EOE%; + disfigured foo/2 + disfigured libbar/2 + purged libbar/2 + configured sys:libbar/2 + configured foo/2 + disfigured libbaz + purged libbaz + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + # Build libbar/2. + # + $pkg_build libbar/2 2>>~%EOE%; + disfigured foo/2 + purged libbar/2 + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + configured libbaz/2 + configured libbar/2 + configured foo/2 + %info: .+ is up to date% + %info: .+ is up to date% + updated libbar/2 + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + $pkg_drop foo libbar + } + + : syslibbar1-foo-libbar + : + : The overall plan is to configure sys:libbar/1, then fail to build foo but + : succeed to build foo libbar. + : + { + $clone_cfg; + + # Build sys:libbar/1. + # + $pkg_build 'sys:libbar/1' 2>'configured sys:libbar/1'; + $pkg_status libbar 1>'configured,system 1 hold_package hold_version; available 2 sys:?'; + $pkg_status libbaz 1>'available 2 sys:?'; + + # Fail to build foo. + # + $pkg_build foo 2>>EOE != 0; + error: package foo dependency on (libbar >= 2) is forcing upgrade of sys:libbar/1 to libbar/2 + info: package version sys:libbar/1 is held + info: explicitly request version upgrade to continue + info: while satisfying foo/2 + EOE + + # Build foo and libbar. + # + $pkg_build foo libbar 2>>~%EOE%; + purged libbar/1 + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/2% + unpacked libbar/2 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured libbaz/2 + configured libbar/2 + configured foo/2 + %info: .+ is up to date% + %info: .+ is up to date% + updated libbar/2 + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured 2 hold_package; available sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + $pkg_drop foo libbar + } + + : foo-syslibbar + : + : Build foo and ?sys:libbar. + : + { + $clone_cfg; + + $pkg_build foo '?sys:libbar' 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/* + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system *; available 2 1 sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } + + : libbar1-foo-syslibbar2 + : + : The overall plan is to configure libbar/1, then fail to build foo but + : succeed to build foo ?sys:libbar/2, and then foo sys:libbar/2. + : + { + $clone_cfg; + + # Build libbar/1. + # + $pkg_build libbar/1 2>>~%EOE%; + %.* + %.*fetched libbaz/2% + unpacked libbaz/2 + %.* + %.*fetched libbar/1% + unpacked libbar/1 + configured libbaz/2 + configured libbar/1 + %info: .+ is up to date% + updated libbar/1 + EOE + + $pkg_status libbar >'configured 1 hold_package hold_version; available 2 sys:?'; + $pkg_status libbaz >'configured 2; available sys:?'; + + # Fail to build foo. + # + $pkg_build foo 2>>EOE != 0; + error: package foo dependency on (libbar >= 2) is forcing upgrade of libbar/1 to 2 + info: package version libbar/1 is held + info: explicitly request version upgrade to continue + info: while satisfying foo/2 + EOE + + # Build foo and ?sys:libbar/2. + # + $pkg_build foo '?sys:libbar/2' 2>>~%EOE%; + disfigured libbar/1 + purged libbar/1 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + disfigured libbaz + purged libbaz + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + # Build foo and sys:libbar/2. + # + $pkg_build foo 'sys:libbar/2' 2>>~%EOE%; + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + $pkg_status libbaz >'available 2 sys:?'; + + $pkg_drop foo libbar + } +} + +: t2 +: +{ + +$clone_cfg && $rep_add $rep/t2 && $rep_fetch + + : no-libbar + : + : Test that the following builds expectedly fails having no libbar available + : in source. + : + { + $clone_cfg; + + $pkg_build foo 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: specify ?sys:libbar if it is available from the system + info: while satisfying foo/2 + EOE + + $pkg_build foo libbar 2>>EOE != 0; + error: libbar is not available in source + info: specify sys:libbar if it is available from the system + EOE + + $pkg_status foo >'available 2 sys:?'; + $pkg_status libbar >'available sys:?' + } + + : foo-syslibbar + : + : Build foo configuring sys:libbar. + : + { + $clone_cfg; + + $pkg_build foo 'sys:libbar' 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/* + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system * hold_package hold_version; available sys:?'; + + $pkg_drop foo libbar + } + + : libbar1-foo-syslibbar2 + : + : The overall plan is to configure sys:libbar/1, then fail to build foo, but + : succeed to build foo sys:libbar/2. + : + { + $clone_cfg; + + # Build sys:libbar/1. + # + $pkg_build 'sys:libbar/1' 2>'configured sys:libbar/1'; + $pkg_status libbar 1>'configured,system 1 hold_package hold_version; available sys:?'; + + # Fail to build foo. + # + $pkg_build foo 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + # Build foo and sys:libbar/2. + # + $pkg_build foo 'sys:libbar/2' 2>>~%EOE%; + purged libbar/1 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + + $pkg_drop foo libbar + } + + : syslibbar2 + : + : The overall plan is to fail to build foo sys:libbar/1, then configure + : sys:libbar/2 but still fail to build foo sys:libbar/1. + : + { + $clone_cfg; + + # Fail to build foo and sys:libbar/1. + # + $pkg_build foo 'sys:libbar/1' 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + # Build sys:libbar/2. + # + $pkg_build 'sys:libbar/2' 2>'configured sys:libbar/2'; + $pkg_status libbar 1>'configured,system 2 hold_package hold_version; available sys:?'; + + # Still fail to build foo and sys:libbar/1. + # + $pkg_build foo 'sys:libbar/1' 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + $pkg_drop libbar + } + + : syslibbar1 + : + : The overall plan is to configure sys:libbar/1, then fail to build + : sys:libbar/1.1 foo. + : + { + $clone_cfg; + + # Build sys:libbar/2. + # + $pkg_build 'sys:libbar/1' 2>'configured sys:libbar/1'; + $pkg_status libbar 1>'configured,system 1 hold_package hold_version; available sys:?'; + + # Fail to build sys:libbar/1.1 and foo. + # + $pkg_build 'sys:libbar/1.1' foo 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1.1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + $pkg_drop libbar + } + + : foo-syslibbar-drop-foo + : + : The overall plan is to build foo ?sys:libbar, then drop foo and make sure + : libbar is purged as well. + : + { + $clone_cfg; + + # Build foo and ?sys:libbar. + # + $pkg_build foo '?sys:libbar' 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/* + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system *; available sys:?'; + + # Drop foo. + # + $pkg_drop foo 2>>EOE; + disfigured foo + purged libbar + purged foo + EOE + + $pkg_status foo >'available 2 sys:?'; + $pkg_status libbar >'available sys:?' + } + + : syslibbar1-foo-syslibbar-drop-foo + : + : The overall plan is to build sys:libbar/1, then fail to build foo but + : succeed to build foo ?sys:libbar, then drop foo and make sure libbar stays. + : + { + $clone_cfg; + + # Build sys:libbar/1. + # + $pkg_build 'sys:libbar/1' 2>'configured sys:libbar/1'; + $pkg_status libbar 1>'configured,system 1 hold_package hold_version; available sys:?'; + + # Fail to build foo. + # + $pkg_build foo 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + # Build foo and '?sys:libbar/2'. + # + $pkg_build foo '?sys:libbar/2' 2>>~%EOE%; + purged libbar/1 + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?'; + + # Drop foo. + # + $pkg_drop foo 2>>EOE; + disfigured foo + purged foo + EOE + + $pkg_status foo >'available 2 sys:?'; + $pkg_status libbar >'configured,system 2 hold_package hold_version; available sys:?' + } +} + +: t3 +: +{ + +$clone_cfg && $rep_add $rep/t3 && $rep_fetch + + : no-libbar + : + : Test that the following builds expectedly fails having no libbar available + : in source. + : + { + $clone_cfg; + + $pkg_build foo 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: specify ?sys:libbar if it is available from the system + info: while satisfying foo/2 + EOE + + $pkg_build 'sys:libbar/1' 2>>EOE != 0; + error: unknown package libbar + EOE + + $pkg_build foo 'sys:libbar/1' 2>>EOE != 0; + error: unknown package libbar + EOE + + $pkg_build foo '?sys:libbar/1' 2>>EOE != 0; + error: prerequisite libbar >= 2 of package foo is not available in source + info: sys:libbar/1 does not satisfy the constrains + info: while satisfying foo/2 + EOE + + $pkg_status foo >'available 2 sys:?'; + $pkg_status libbar >'unknown' + } + + : syslibbar1-foo-syslibbar-drop-foo + : + : The overall plan is to build foo ?sys:libbar/2, fail to build sys:libbar + : and foo 'sys:libbar', but succeed to build foo ?sys:libbar/3 and foo + : ?sys:libbar. + : + { + $clone_cfg; + + # Build foo '?sys:libbar/2'. + # + $pkg_build foo '?sys:libbar/2' 2>>~%EOE%; + %.* + %.*fetched foo/2% + unpacked foo/2 + configured sys:libbar/2 + configured foo/2 + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2'; + + # Fail as libbar while being selected is still unknown (not present in t3 + # repo). + # + $pkg_build 'sys:libbar' 2>'error: unknown package libbar' != 0; + $pkg_build foo 'sys:libbar' 2>'error: unknown package libbar' != 0; + $pkg_status foo 1>'configured 2 hold_package; available sys:?'; + $pkg_status libbar 1>'configured,system 2'; + + # Build foo and ?sys:libbar/3. Note that libbar stays as system version 2. + # + $pkg_build foo '?sys:libbar/3' 2>>~%EOE%; + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2'; + + # Build foo and ?sys:libbar. + # + $pkg_build foo '?sys:libbar' 2>>~%EOE%; + %info: .+ is up to date% + updated foo/2 + EOE + + $pkg_status foo >'configured 2 hold_package; available sys:?'; + $pkg_status libbar >'configured,system 2'; + + $pkg_drop foo + } +} diff --git a/tests/pkg-system/foo-2.tar.gz b/tests/pkg-system/foo-2.tar.gz new file mode 100644 index 0000000..7fef159 Binary files /dev/null and b/tests/pkg-system/foo-2.tar.gz differ diff --git a/tests/pkg-system/libbar-0+1.tar.gz b/tests/pkg-system/libbar-0+1.tar.gz new file mode 100644 index 0000000..9f90936 Binary files /dev/null and b/tests/pkg-system/libbar-0+1.tar.gz differ diff --git a/tests/pkg-system/libbar-1.tar.gz b/tests/pkg-system/libbar-1.tar.gz new file mode 100644 index 0000000..4b52278 Binary files /dev/null and b/tests/pkg-system/libbar-1.tar.gz differ diff --git a/tests/pkg-system/libbar-2.tar.gz b/tests/pkg-system/libbar-2.tar.gz new file mode 100644 index 0000000..28ad509 Binary files /dev/null and b/tests/pkg-system/libbar-2.tar.gz differ diff --git a/tests/pkg-system/libbaz-2.tar.gz b/tests/pkg-system/libbaz-2.tar.gz new file mode 100644 index 0000000..3e9c3e6 Binary files /dev/null and b/tests/pkg-system/libbaz-2.tar.gz differ diff --git a/tests/pkg-system/t1/foo-2.tar.gz b/tests/pkg-system/t1/foo-2.tar.gz new file mode 120000 index 0000000..39d2e10 --- /dev/null +++ b/tests/pkg-system/t1/foo-2.tar.gz @@ -0,0 +1 @@ +../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t1/libbar-1.tar.gz b/tests/pkg-system/t1/libbar-1.tar.gz new file mode 120000 index 0000000..971bed1 --- /dev/null +++ b/tests/pkg-system/t1/libbar-1.tar.gz @@ -0,0 +1 @@ +../libbar-1.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t1/libbar-2.tar.gz b/tests/pkg-system/t1/libbar-2.tar.gz new file mode 120000 index 0000000..2c8027b --- /dev/null +++ b/tests/pkg-system/t1/libbar-2.tar.gz @@ -0,0 +1 @@ +../libbar-2.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t1/libbaz-2.tar.gz b/tests/pkg-system/t1/libbaz-2.tar.gz new file mode 120000 index 0000000..111a2e7 --- /dev/null +++ b/tests/pkg-system/t1/libbaz-2.tar.gz @@ -0,0 +1 @@ +../libbaz-2.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t1/repositories b/tests/pkg-system/t1/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg-system/t1/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/pkg-system/t2/foo-2.tar.gz b/tests/pkg-system/t2/foo-2.tar.gz new file mode 120000 index 0000000..39d2e10 --- /dev/null +++ b/tests/pkg-system/t2/foo-2.tar.gz @@ -0,0 +1 @@ +../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t2/libbar-0+1.tar.gz b/tests/pkg-system/t2/libbar-0+1.tar.gz new file mode 120000 index 0000000..82bdcba --- /dev/null +++ b/tests/pkg-system/t2/libbar-0+1.tar.gz @@ -0,0 +1 @@ +../libbar-0+1.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t2/repositories b/tests/pkg-system/t2/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg-system/t2/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/pkg-system/t3/foo-2.tar.gz b/tests/pkg-system/t3/foo-2.tar.gz new file mode 120000 index 0000000..39d2e10 --- /dev/null +++ b/tests/pkg-system/t3/foo-2.tar.gz @@ -0,0 +1 @@ +../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg-system/t3/repositories b/tests/pkg-system/t3/repositories new file mode 100644 index 0000000..2715634 --- /dev/null +++ b/tests/pkg-system/t3/repositories @@ -0,0 +1,3 @@ +: 1 +location: ../t2 +: \ No newline at end of file diff --git a/tests/pkg-unpack.test b/tests/pkg-unpack.test new file mode 100644 index 0000000..49faffa --- /dev/null +++ b/tests/pkg-unpack.test @@ -0,0 +1,199 @@ +# file : tests/pkg-unpack.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# pkg-unpack +# |-- hello +# | |-- libhello-1.0.0.tar.gz +# | `-- repositories +# |-- libfoo-1.1.0 +# | |-- build +# | | `-- bootstrap.build +# | |-- buildfile +# | `-- manifest +# `-- t1 +# |-- libfoo-1.0.0.tar.gz +# |-- libfoo-1.1.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature + + # Create the 't1' repository. + # + cp -r $src/t1 $out/t1 && $rep_create $out/t1 &$out/t1/packages +end + +pkg_fetch += -d cfg 2>- +pkg_purge += -d cfg +pkg_status += -d cfg +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all 2>- + +: replace-with-existing +: +$clone_cfg; +$* -r 2>>EOE != 0 + error: --replace|-r can only be specified with --existing|-e + EOE + +: no-dir +: +$clone_cfg; +$* -e 2>>EOE != 0 + error: package directory argument expected + info: run 'bpkg help pkg-unpack' for more information + EOE + +: not-package-dir +: +$clone_cfg; +$* -e ./ 2>>/EOE != 0 + error: no manifest file in package directory ./ + EOE + +: dir-not-exist +: +$clone_cfg; +$* -e ./no-such-dir 2>>/EOE != 0 + error: package directory ./no-such-dir/ does not exist + EOE + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-unpack' for more information + EOE + +: fetched-rep +: +{ + +$clone_cfg && $rep_add $rep/t1 && $rep_fetch --trust-yes + + : package-exists + : + { + $clone_cfg && $pkg_fetch libfoo/1.0.0; + + $* -e $src/libfoo-1.1.0 2>>/EOE != 0; + error: package libfoo already exists in configuration cfg/ + info: version: 1.0.0, state: fetched, substate: none + info: use 'pkg-unpack --replace|-r' to replace + EOE + + $pkg_purge libfoo 2>'purged libfoo/1.0.0'; + $* -e $src/libfoo-1.1.0 2>'unpacked libfoo/1.1.0'; + $pkg_status libfoo/1.1.0 1>'unpacked; available'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : replace-fetched + : + { + $clone_cfg && $pkg_fetch libfoo/1.0.0; + + $* -e $src/libfoo-1.1.0 2>>/EOE != 0; + error: package libfoo already exists in configuration cfg/ + info: version: 1.0.0, state: fetched, substate: none + info: use 'pkg-unpack --replace|-r' to replace + EOE + + $* -r -e $src/libfoo-1.1.0 2>'unpacked libfoo/1.1.0'; + $pkg_status libfoo/1.1.0 1>'unpacked; available'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : replace-unpacked + : + { + $clone_cfg && $pkg_fetch libfoo/1.0.0; + + $* libfoo 2>'unpacked libfoo/1.0.0'; + + $* -e $src/libfoo-1.1.0 2>>/EOE != 0; + error: package libfoo already exists in configuration cfg/ + info: version: 1.0.0, state: unpacked, substate: none + info: use 'pkg-unpack --replace|-r' to replace + EOE + + $* -r -e $src/libfoo-1.1.0 2>'unpacked libfoo/1.1.0'; + $pkg_status libfoo/1.1.0 1>'unpacked; available'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : wrong-state + : + { + $clone_cfg; + + $* libfoo 2>>/EOE != 0; + error: package libfoo does not exist in configuration cfg/ + EOE + + $* -e $src/libfoo-1.1.0 2>'unpacked libfoo/1.1.0'; + + $* libfoo 2>>EOE != 0; + error: package libfoo is unpacked + info: expected it to be fetched + EOE + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } + + : right-state + : + { + $clone_cfg && $pkg_fetch libfoo/1.0.0; + + $pkg_status libfoo/1.0.0 1>'fetched; available'; + $* libfoo 2>'unpacked libfoo/1.0.0'; + $pkg_status libfoo/1.0.0 1>'unpacked; available'; + + $pkg_purge libfoo 2>'purged libfoo/1.0.0' + } + + : purge-existing + : + { + $clone_cfg; + + # @@ Use --no-cleanup for cp builtin when implemented. + # + d = &!libfoo-1.1.0/; + c = $d/ $d/build/ $d/build/bootstrap.build $d/buildfile $d/manifest; + cp -r $src/libfoo-1.1.0 ./ $c; + + $* -p -e libfoo-1.1.0 2>'unpacked libfoo/1.1.0'; + + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } +} + +: hello +: +{ + $clone_cfg; + $rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/***; + $pkg_fetch libhello/1.0.0; + + $* libhello 2>'unpacked libhello/1.0.0'; + + $pkg_purge libhello 2>'purged libhello/1.0.0' +} diff --git a/tests/pkg-unpack/hello b/tests/pkg-unpack/hello new file mode 120000 index 0000000..e10a7f8 --- /dev/null +++ b/tests/pkg-unpack/hello @@ -0,0 +1 @@ +../common/hello \ No newline at end of file diff --git a/tests/pkg-unpack/libfoo-1.1.0 b/tests/pkg-unpack/libfoo-1.1.0 new file mode 120000 index 0000000..15fcf5c --- /dev/null +++ b/tests/pkg-unpack/libfoo-1.1.0 @@ -0,0 +1 @@ +../common/libfoo-1.1.0 \ No newline at end of file diff --git a/tests/pkg-unpack/t1 b/tests/pkg-unpack/t1 new file mode 120000 index 0000000..a27d298 --- /dev/null +++ b/tests/pkg-unpack/t1 @@ -0,0 +1 @@ +../common/t1 \ No newline at end of file diff --git a/tests/pkg-update.test b/tests/pkg-update.test new file mode 100644 index 0000000..c64b309 --- /dev/null +++ b/tests/pkg-update.test @@ -0,0 +1,148 @@ +# file : tests/pkg-update.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# pkg-update +# |-- hello +# | |-- libhello-1.0.0.tar.gz +# | `-- repositories +# `-- libhello-1.0.0 +# |-- build +# | |-- bootstrap.build +# | |-- export.build +# | `-- root.build +# |-- buildfile +# |-- hello +# | |-- buildfile +# | |-- export +# | |-- hello +# | `-- hello.cxx +# |-- INSTALL +# |-- manifest +# |-- tests +# | |-- build +# | | |-- bootstrap.build +# | | `-- root.build +# | |-- buildfile +# | `-- test +# | |-- buildfile +# | |-- driver.cxx +# | `-- test.out +# `-- version + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature +end + +pkg_configure += -d cfg "config.cxx=$config.cxx" 2>- +pkg_disfigure += -d cfg +pkg_fetch += -d cfg 2>- +pkg_purge += -d cfg +pkg_unpack += -d cfg 2>- +rep_add += -d cfg 2>- +rep_fetch += -d cfg --auth all 2>- + +# Sometimes we need to run underlying build update operation with -j 1 options +# to have an output that we can match reliably. +# +j1 = --build-option -j --build-option 1 + +: no-name +: +$clone_cfg; +$* 2>>EOE != 0 + error: package name argument expected + info: run 'bpkg help pkg-update' for more information + EOE + +: fetched +: +{ + +$clone_cfg + +$rep_add $rep/hello && $rep_fetch --trust $cert_fp &cfg/.bpkg/certs/*** + + : no-such-package + : + $clone_cfg; + $* libhello 2>>/EOE != 0 + error: package libhello does not exist in configuration cfg/ + EOE + + : wrong-state + : + { + $clone_cfg && $pkg_fetch libhello/1.0.0; + + $* libhello 2>>EOE != 0; + error: package libhello is fetched + info: expected it to be configured + EOE + + $pkg_purge libhello 2>'purged libhello/1.0.0' + } + + : src-eq-out + : + { + $clone_cfg; + $pkg_fetch libhello/1.0.0 && $pkg_unpack libhello; + $pkg_configure libhello; + + $* $j1 libhello 2>>~%EOE%; + %c\+\+ .+% + %ld .+% + %c\+\+ .+% + %ld .+% + %c\+\+ .+% + %ld .+% + updated libhello/1.0.0 + EOE + + $* libhello 2>>~%EOE%; + %info: .+ is up to date% + updated libhello/1.0.0 + EOE + + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_purge libhello 2>'purged libhello/1.0.0' + } +} + +: src-ne-out +: +{ + $clone_cfg; + $pkg_unpack -e $src/libhello-1.0.0 && $pkg_configure libhello; + + $* $j1 libhello 2>>~%EOE%; + %mkdir .+% + %mkdir .+% + %c\+\+ .+% + %ld .+% + %c\+\+ .+% + %ld .+% + %c\+\+ .+% + %ld .+% + updated libhello/1.0.0 + EOE + + $* libhello 2>>~%EOE%; + %info: .+ is up to date% + updated libhello/1.0.0 + EOE + + $pkg_disfigure libhello 2>'disfigured libhello/1.0.0'; + $pkg_purge libhello 2>'purged libhello/1.0.0' +} diff --git a/tests/pkg-update/hello b/tests/pkg-update/hello new file mode 120000 index 0000000..e10a7f8 --- /dev/null +++ b/tests/pkg-update/hello @@ -0,0 +1 @@ +../common/hello \ No newline at end of file diff --git a/tests/pkg-update/libhello-1.0.0 b/tests/pkg-update/libhello-1.0.0 new file mode 120000 index 0000000..a6f638b --- /dev/null +++ b/tests/pkg-update/libhello-1.0.0 @@ -0,0 +1 @@ +../common/libhello-1.0.0 \ No newline at end of file diff --git a/tests/pkg-verify.test b/tests/pkg-verify.test new file mode 100644 index 0000000..9d9c714 --- /dev/null +++ b/tests/pkg-verify.test @@ -0,0 +1,59 @@ +# file : tests/pkg-verify.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test + +# Source repository: +# +# pkg-verify +# |-- foo-1.tar.gz +# |-- foo-2.tar.gz (manifest with unknown name) +# `-- not-a-package.tar.gz + +: valid-package +: +$* $src/foo-1.tar.gz 2>'valid package foo 1' + +: no-package +: +$* 2>>EOE != 0 +error: archive path argument expected + info: run 'bpkg help pkg-verify' for more information +EOE + +: not-a-package +: +{ + : verbose + : + $* $src/not-a-package.tar.gz 2>>/~%EOE% != 0 + %.+ + %error: .+/not-a-package.tar.gz does not appear to be a bpkg package% + EOE + + : silent + : + $* --silent $src/not-a-package.tar.gz != 0 +} + +: unknown-name +: +: Test that package manifest that contains an unknown name is properly handled. +: +{ + : verbose + : + $* $src/foo-2.tar.gz 2>>/~%EOE% != 0 + foo-2/manifest:8:1: error: unknown name 'color' in package manifest + % info: package archive .+/foo-2.tar.gz% + EOE + + : silent + : + $* --silent $src/foo-2.tar.gz != 0 + + : ignore + : + $* --ignore-unknown $src/foo-2.tar.gz 2>'valid package foo 2' +} diff --git a/tests/pkg-verify/foo-1.tar.gz b/tests/pkg-verify/foo-1.tar.gz new file mode 120000 index 0000000..7a0bc92 --- /dev/null +++ b/tests/pkg-verify/foo-1.tar.gz @@ -0,0 +1 @@ +../common/foo-1.tar.gz \ No newline at end of file diff --git a/tests/pkg-verify/foo-2.tar.gz b/tests/pkg-verify/foo-2.tar.gz new file mode 100644 index 0000000..cb39194 Binary files /dev/null and b/tests/pkg-verify/foo-2.tar.gz differ diff --git a/tests/pkg-verify/not-a-package.tar.gz b/tests/pkg-verify/not-a-package.tar.gz new file mode 100644 index 0000000..be3823a Binary files /dev/null and b/tests/pkg-verify/not-a-package.tar.gz differ diff --git a/tests/pkg/.gitignore b/tests/pkg/.gitignore deleted file mode 100644 index cd1ec36..0000000 --- a/tests/pkg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -packages -signature diff --git a/tests/pkg/1/build2.org/auth/create-expired/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/create-expired/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/create-expired/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/create-expired/repositories b/tests/pkg/1/build2.org/auth/create-expired/repositories deleted file mode 100644 index 8370fa4..0000000 --- a/tests/pkg/1/build2.org/auth/create-expired/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAPIoh0763iYdMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNTAxMTA1MDMyWhcNMTYwNTAyMTA1MDMyWjAzMRcwFQYDVQQKDA5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAAb+Yxvqi4sOZ+Ti8wcxkxqFrIs32M3XgJIeZYJn9JZbtjuBx0JFZWnL/tz4M -VTiM2nrUc4qIIpTqEt2If1NcdH0Cjvf6vysLvIOoB4q09B+aW4F+19moixYodoDp -qq1Ki1MZrBMx+KUICagqRSklPyxaZ2rEFv2TY0pg8/QRFRWGCFgdWJleX6VsqIXC -KDK6MyHfR1gsDnZZfgr7HJCq1SH3loqlchLBvAF6K/c1LdQyJFYoP4xAt6yaQWzv -wEqqhhZ7tLpjrjK0K2pqsPoupNcNhE31k+6ZdM5Z5oHT844qKIVNJIdlvFwnQ3ed -grP6gBCLVY7h7GJ0x2ZG/2hYt4My8RqLxFYHaHAzQsmXFATIzT1Yqz1nw+8V3l5P -m+rXQNVAw7rgpl3T7klbHVfkg5rPa0kF66PkKq5ax46NS6KVj9sNOqkcXL7huQSG -BnSLTkaLwwrSZWl+DPXeY8TgUGkkEMY6RvYdqoOGZiZSqtMfK9QKsFi79a4Munc8 -ypUPxE++jhtXcarDy0ta3BXrspIg63a2Ab6C5yv2fC31Ec5v75rUxt9BVxMMQdlX -h9eMe5FmkgkSBcklOShE2kZvTOPUCSq8DK7JuKsKEH3istPto+PpoyT8RxuZ9K2Q -rr78CskHtj+TVdFv7TAqn2YDx9ki4HJIxWKVanJ+zOBSrJw= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/create-noemail/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/create-noemail/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/create-noemail/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/create-noemail/repositories b/tests/pkg/1/build2.org/auth/create-noemail/repositories deleted file mode 100644 index 3645b23..0000000 --- a/tests/pkg/1/build2.org/auth/create-noemail/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFEzCCAvugAwIBAgIJANxwhIzYRCmBMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNTAxMTYwODQyWhcNMTcwNTAxMTYwODQyWjAzMRcwFQYDVQQKDA5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaMqMCgwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMA0GCSqGSIb3DQEBCwUAA4ICAQC4bolUadknEL7ryAGisjFxK0WkH4zNDGrV -c3c27jHfr7D/GXqMvAkpE9aXwbBDTkgmsvQMkLx4on1WewLFVuDfyvqAS2IGU9i4 -7bbCaACkrhEb1PYvZ8mbVJiXSfnwHSmbEeBbVlej9OqFga2+drv2cI1cqpPZJKhF -UiUstPYl6vFONE5hLGxKI+6Xg6HYkkc/qawCmY3fuNxC5Hv4n0dwQGdcUqMt5oMK -1NhfPnunBXY2d/N3SaeBh8PW9Wk5zDq/S2LcO6fgdSho3R3oGbkHj52wPLWK93Vr -IBU1NhswvR69IOT92UG5KAqHK3VFp8EatuvbODQpvd0uuwIf7BO4Cj7ZPy5R7u8c -6fwyP1C/jTwSER143NA0LlmjR+qowsicz7zhBI4Fv6dj4rO725lnZ0+Sqok/45SR -jYdSPZnyWhiWh2ImfMC5INIlWvTtpL6dbfbkR1ZVABVkn3j0Xe4kpsFrmhY693mJ -LY8PTKJpIZeoj/XrnTDm/NgwcDHpS8j3F++DwZ2UxzJSOgmL9NJlC1lf1ehhxQt8 -33+/zTw6VXwK0PUputdS7xf7z+10Yf4el1kEoAzWZwaz5bwVFOyCQHPCYxuSUKz+ -O0X8FWd2wgPCmU6CB518Cv9cOyUfoZZuV3Va/IyoOUvwNd5Lxen0mo2LPNlXRMVM -e44+PKmbFA== ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/expired/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/expired/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/expired/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/expired/packages b/tests/pkg/1/build2.org/auth/expired/packages deleted file mode 100644 index 9aaf177..0000000 --- a/tests/pkg/1/build2.org/auth/expired/packages +++ /dev/null @@ -1,11 +0,0 @@ -: 1 -sha256sum: ba75221f5f610f5f9ebee19a7449dfcff5c9fb2c7d87d2482b8324c4ea419950 -: -name: libfoo -version: 1.0.0 -summary: libfoo -license: MIT -url: http://example.org -email: pkg@example.org -location: libfoo-1.0.0.tar.gz -sha256sum: 642aa60cda80f6579247dfc64192c67ec3f2ed932ae2f56e592000ad9fea435d diff --git a/tests/pkg/1/build2.org/auth/expired/repositories b/tests/pkg/1/build2.org/auth/expired/repositories deleted file mode 100644 index 8370fa4..0000000 --- a/tests/pkg/1/build2.org/auth/expired/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAPIoh0763iYdMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNTAxMTA1MDMyWhcNMTYwNTAyMTA1MDMyWjAzMRcwFQYDVQQKDA5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAAb+Yxvqi4sOZ+Ti8wcxkxqFrIs32M3XgJIeZYJn9JZbtjuBx0JFZWnL/tz4M -VTiM2nrUc4qIIpTqEt2If1NcdH0Cjvf6vysLvIOoB4q09B+aW4F+19moixYodoDp -qq1Ki1MZrBMx+KUICagqRSklPyxaZ2rEFv2TY0pg8/QRFRWGCFgdWJleX6VsqIXC -KDK6MyHfR1gsDnZZfgr7HJCq1SH3loqlchLBvAF6K/c1LdQyJFYoP4xAt6yaQWzv -wEqqhhZ7tLpjrjK0K2pqsPoupNcNhE31k+6ZdM5Z5oHT844qKIVNJIdlvFwnQ3ed -grP6gBCLVY7h7GJ0x2ZG/2hYt4My8RqLxFYHaHAzQsmXFATIzT1Yqz1nw+8V3l5P -m+rXQNVAw7rgpl3T7klbHVfkg5rPa0kF66PkKq5ax46NS6KVj9sNOqkcXL7huQSG -BnSLTkaLwwrSZWl+DPXeY8TgUGkkEMY6RvYdqoOGZiZSqtMfK9QKsFi79a4Munc8 -ypUPxE++jhtXcarDy0ta3BXrspIg63a2Ab6C5yv2fC31Ec5v75rUxt9BVxMMQdlX -h9eMe5FmkgkSBcklOShE2kZvTOPUCSq8DK7JuKsKEH3istPto+PpoyT8RxuZ9K2Q -rr78CskHtj+TVdFv7TAqn2YDx9ki4HJIxWKVanJ+zOBSrJw= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/expired/signature b/tests/pkg/1/build2.org/auth/expired/signature deleted file mode 100644 index dc2aeee..0000000 --- a/tests/pkg/1/build2.org/auth/expired/signature +++ /dev/null @@ -1,13 +0,0 @@ -: 1 -sha256sum: cd05e2ebe9dac484950a54e95a76efba0cac27ec5148dc34fa23a5cd7da72e3d -signature: \ -geWdw7Gm+Rt+CLDMBby5Y796E8rxwImb0bmcZwGWar9D3vkFm9Kjh00Buuo1PuU7tP1dV6yvRbH8 -NzC0IryEoUJHx9909AJ449ET9Zb+C3ykEeBlKH2wonj7cAVK9ZEDpPEGAtp56XWZQEawl50mwq6t -XkZAABxtOswXiicdh3HK7kaPHp38/9CBMc0rva6wDnkbTigUYA2ULqLtP5a5mLovVc48zI9A/hmb -Qx1/Nr7nzTZNDGK7CwTAb1fPam9rZklTfCTPSPUUjvWjM9XdY8cbRE1FrE14TXdyQPxCLzHO2dUO -YWH5/qMikEoCYhYXQ6KhekoT/MUiVC3PMcYQbYOrOtSxq6RcgnymexBe1XIyld5Rfo1eXu8TK11r -QPULIqAGy6RwEUhGznuEiGHQwb1UymNyJ/qgr4vBPjJtlvptqG5XNmtiJ22f07nmeVRi2Vg2UyOw -HoVpy5t/w0tEnUXPA39Vt0v1bUm7Knhc8qL4JFEqK/j/CzEHzEtAjn0aoGuKubCO0WUa+v6ZlkLU -YrNUIdgT1wgj4yEhLO3g+NsnxFH05D2sfR16rrkI2E6st5crAHR8FOl2FDsWxgKqNbzXZw7rl+Fa -TobGycX7MDf2mbBmR/KmEkMBJ4mziWLAycSAGyE5VRYDwHPJlQE0143wBzT8eNw4VLm/r+88VYw= -\ diff --git a/tests/pkg/1/build2.org/auth/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/libfoo-1.0.0.tar.gz deleted file mode 100644 index 28a6a90..0000000 Binary files a/tests/pkg/1/build2.org/auth/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/auth/name-mismatch/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/name-mismatch/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/name-mismatch/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/name-mismatch/repositories b/tests/pkg/1/build2.org/auth/name-mismatch/repositories deleted file mode 100644 index 15fa092..0000000 --- a/tests/pkg/1/build2.org/auth/name-mismatch/repositories +++ /dev/null @@ -1,34 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFXTCCA0WgAwIBAgIJANXKeBuJax30MA0GCSqGSIb3DQEBCwUAMEoxFzAVBgNV -BAoMDkNvZGUgU3ludGhlc2lzMS8wLQYDVQQDDCZuYW1lOmJ1aWxkMi5vcmcvYXV0 -aC9taXNtYXRjaGVkL25hbWUveDAeFw0xNjA1MDMyMzUyNDJaFw0xNzA1MDMyMzUy -NDJaMEoxFzAVBgNVBAoMDkNvZGUgU3ludGhlc2lzMS8wLQYDVQQDDCZuYW1lOmJ1 -aWxkMi5vcmcvYXV0aC9taXNtYXRjaGVkL25hbWUveDCCAiIwDQYJKoZIhvcNAQEB -BQADggIPADCCAgoCggIBANq78SXuzFzCMoFU1RnzEeAfzE0UUYGynS3F2lG7viH3 -coxjLt+BrFBudVs4XDTpjXS19hRxIohEgD71W1jhDvmUC9yCMW13PCIIjRKTTz0e -fEhTcMHdhOgvKZsje0IV7svoKVXcG7DfUVl51wWPQPSbUrfsQbsXg7Pz5HaDx+Dt -2i9hwdE1M0z4R2dtwQkszFyCKiX8RF9oPXirTz5ETLC3f19JUapLrY5l5ZylzQif -LhPMlHLlrT0n7KkohH7waX3KyeLa0M2IIl3zaeAsuN+ErFVecAdlJIvX00cth2OO -/Gxy09sIKlagi2q7ZDik2sMvG8dAv7gNZsXp+FOj/XXCiOI9f6D5ospJdK9B5UCA -BjmGc8W5Odv6ZLey5Ui76luI7ciITOKfAoEkbyMiNHiRxLdM7aAeizdcwHU4bm6J -lmiJk8UyyV85f33mvCSfuo7D+DQYiK650/xwRdTFBIqi38IwME62gT7ah/AOmiPs -hj7FjwIU7ZWHskyr9qpExQOEKJXoLZJo1rf6MRc8AsJyz6zdfQhT1BTzhogNfru4 -xjVM6fSrjRUF34msuWcz/HKo9W350Aw2y5F59kziP+m7G6uBYrqmElv/13Vamg2Z -Z1b38KMz5Ss3SkfcDErOzz/D+0hRlOaCIeWts1G2zWcQvBnn+zGA+sTIu0xAFOCR -AgMBAAGjRjBEMA4GA1UdDwEB/wQEAwIHgDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD -AzAaBgNVHREEEzARgQ9pbmZvQGJ1aWxkMi5vcmcwDQYJKoZIhvcNAQELBQADggIB -AKvUnaZP20bf4ahpa50QUvRb4Kel7yhvvmae7/aIBk5ANxnJC3yuOpmtGve5+lLE -+6w/XwFASz/7PAdUlEp+LBYknGnx5StoqBzP7nwapm+tBcrZ3Q5MxareXXOSx1Ac -4Dh9vDMRevDHZ5LQATHG+Q7zaKmBb0ZeSjJlP4+0680AKN4YDmY1a81uoa1jRXbV -c4iutSoBaVNdWB5+GGelEjvhzN0gZ22IpS3mjbyCbJNywHQMHBLwtxuFgkdOfPkC -MGBbvG5TD7SKgQNlfsoQu3UJpokzz7hP1TmjCpSDjGSqJlYvovrHCFQGWjtk0UVQ -tXAQiVPlMsj2kbxJf2ICYYZuvQbmhvNF049ldrpk26jlDzSZ+5t2jueC+q8knTsn -p3LPx7sqGfkIq41pxHAQseBSYUEo6r6LwfDQPmwb7fOUpLJm6GdsEkqqUhmB3W6Y -H4t6PKCjFI91JqTka6oF3Lblf3QLXlMpevBwvgaZAC1d4eiNPq+mSAL6T2Cb8Hvq -Imzyh6EcMbWD9RSnbDCujBjnj0WXO7VjUqShZ60D78PCdXbaK7RAOX9cLUYO/OHd -z5vUbBrPvDImu5gJFRLOGKKw/7Yn9um/pyuSHuuucBkjBJ4J/tPi/MBZiWM7g2qc -obzYoLev74dMkZMZDsGDAcuYX40ZVkF7ATqZC405/fSH ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/sha256sum-mismatch/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/sha256sum-mismatch/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/sha256sum-mismatch/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/sha256sum-mismatch/repositories b/tests/pkg/1/build2.org/auth/sha256sum-mismatch/repositories deleted file mode 100644 index 9bcb20a..0000000 --- a/tests/pkg/1/build2.org/auth/sha256sum-mismatch/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAK41T2Si9cMEMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoTDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDEw9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNDMwMTQyNDQ3WhcNMTcwNDMwMTQyNDQ3WjAzMRcwFQYDVQQKEw5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAxMPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAeBHkz12OPjjFPftCZ8u/9Kq+W0ZnqQqXmSLj5SQFiG5PEUSV19XFcGawwjbU -6guceUSHhHQr/KhpV02pyoPPtskdognHQCPr6HCR6eeEtfBUSum5dKpJAWqGhszg -bPCb11/ksBBzpBbc/C+gnU8ZvsglJ/wxrizZ0AYeSdvyWq8pgoh2vGpgdhK5MWhd -rVGQm+TUVmXyQwNrYDjqhoGZF02UilIekedegWUEvkXnk5rzyzTaX+GwlnsplVY2 -Xijn8cWkO4cCDkthyjfNPgUm8ZgKuBgs+OYRbW4XtuXgeBucBVCryrM8+3OSmzbs -IBQWL0EDT7bnt2ukE+cUx8Foc/+180KZAdDbUY9MOsYCac3bXnIJd/q1pzkr+OvL -EXnuIGuzUqVkcD4+ABaWefNUm3KeZwBAupYc9eo2/YzpCUsgAe0PAdgJhcg9D4kX -2RwwjVpOPWUxevrPq32Lo3R8obfl2aCLzcuiuheb1EcJLlAH67KqdXLDpvZqJ9qi -iaBCixRl2t3our5VSBWQQefGnH6DWn1JM34zyBbeZdgjyqebSN42p+hADYe2qzdf -AviHJsBwvt3HYpr3bfU6EDx1cU5D6gNAxzZMkZhnEQ7u6kXDcLyWJhgXcZhGT0xv -D/x+fIGI1t2XkoOmvuno1MqoDQX3sCYd0bfB/9wwzcNexic= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/signature-mismatch/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/signature-mismatch/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/signature-mismatch/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/signature-mismatch/repositories b/tests/pkg/1/build2.org/auth/signature-mismatch/repositories deleted file mode 100644 index 9bcb20a..0000000 --- a/tests/pkg/1/build2.org/auth/signature-mismatch/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAK41T2Si9cMEMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoTDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDEw9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNDMwMTQyNDQ3WhcNMTcwNDMwMTQyNDQ3WjAzMRcwFQYDVQQKEw5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAxMPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAeBHkz12OPjjFPftCZ8u/9Kq+W0ZnqQqXmSLj5SQFiG5PEUSV19XFcGawwjbU -6guceUSHhHQr/KhpV02pyoPPtskdognHQCPr6HCR6eeEtfBUSum5dKpJAWqGhszg -bPCb11/ksBBzpBbc/C+gnU8ZvsglJ/wxrizZ0AYeSdvyWq8pgoh2vGpgdhK5MWhd -rVGQm+TUVmXyQwNrYDjqhoGZF02UilIekedegWUEvkXnk5rzyzTaX+GwlnsplVY2 -Xijn8cWkO4cCDkthyjfNPgUm8ZgKuBgs+OYRbW4XtuXgeBucBVCryrM8+3OSmzbs -IBQWL0EDT7bnt2ukE+cUx8Foc/+180KZAdDbUY9MOsYCac3bXnIJd/q1pzkr+OvL -EXnuIGuzUqVkcD4+ABaWefNUm3KeZwBAupYc9eo2/YzpCUsgAe0PAdgJhcg9D4kX -2RwwjVpOPWUxevrPq32Lo3R8obfl2aCLzcuiuheb1EcJLlAH67KqdXLDpvZqJ9qi -iaBCixRl2t3our5VSBWQQefGnH6DWn1JM34zyBbeZdgjyqebSN42p+hADYe2qzdf -AviHJsBwvt3HYpr3bfU6EDx1cU5D6gNAxzZMkZhnEQ7u6kXDcLyWJhgXcZhGT0xv -D/x+fIGI1t2XkoOmvuno1MqoDQX3sCYd0bfB/9wwzcNexic= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/signed/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/signed/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/signed/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/signed/repositories b/tests/pkg/1/build2.org/auth/signed/repositories deleted file mode 100644 index 9bcb20a..0000000 --- a/tests/pkg/1/build2.org/auth/signed/repositories +++ /dev/null @@ -1,33 +0,0 @@ -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAK41T2Si9cMEMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoTDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDEw9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNDMwMTQyNDQ3WhcNMTcwNDMwMTQyNDQ3WjAzMRcwFQYDVQQKEw5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAxMPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAeBHkz12OPjjFPftCZ8u/9Kq+W0ZnqQqXmSLj5SQFiG5PEUSV19XFcGawwjbU -6guceUSHhHQr/KhpV02pyoPPtskdognHQCPr6HCR6eeEtfBUSum5dKpJAWqGhszg -bPCb11/ksBBzpBbc/C+gnU8ZvsglJ/wxrizZ0AYeSdvyWq8pgoh2vGpgdhK5MWhd -rVGQm+TUVmXyQwNrYDjqhoGZF02UilIekedegWUEvkXnk5rzyzTaX+GwlnsplVY2 -Xijn8cWkO4cCDkthyjfNPgUm8ZgKuBgs+OYRbW4XtuXgeBucBVCryrM8+3OSmzbs -IBQWL0EDT7bnt2ukE+cUx8Foc/+180KZAdDbUY9MOsYCac3bXnIJd/q1pzkr+OvL -EXnuIGuzUqVkcD4+ABaWefNUm3KeZwBAupYc9eo2/YzpCUsgAe0PAdgJhcg9D4kX -2RwwjVpOPWUxevrPq32Lo3R8obfl2aCLzcuiuheb1EcJLlAH67KqdXLDpvZqJ9qi -iaBCixRl2t3our5VSBWQQefGnH6DWn1JM34zyBbeZdgjyqebSN42p+hADYe2qzdf -AviHJsBwvt3HYpr3bfU6EDx1cU5D6gNAxzZMkZhnEQ7u6kXDcLyWJhgXcZhGT0xv -D/x+fIGI1t2XkoOmvuno1MqoDQX3sCYd0bfB/9wwzcNexic= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/auth/unsigned1/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/unsigned1/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/unsigned1/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/unsigned1/repositories b/tests/pkg/1/build2.org/auth/unsigned1/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/auth/unsigned1/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/auth/unsigned2/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/auth/unsigned2/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/auth/unsigned2/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/auth/unsigned2/repositories b/tests/pkg/1/build2.org/auth/unsigned2/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/auth/unsigned2/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/common/bar/stable/libbar-1.0.0.tar.gz b/tests/pkg/1/build2.org/common/bar/stable/libbar-1.0.0.tar.gz deleted file mode 100644 index d77c1ba..0000000 Binary files a/tests/pkg/1/build2.org/common/bar/stable/libbar-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/bar/stable/repositories b/tests/pkg/1/build2.org/common/bar/stable/repositories deleted file mode 100644 index b8ecc1f..0000000 --- a/tests/pkg/1/build2.org/common/bar/stable/repositories +++ /dev/null @@ -1,6 +0,0 @@ -# bar/stable -# -: 1 -location: ../../foo/stable -: - diff --git a/tests/pkg/1/build2.org/common/bar/testing/libbar-1.1.0.tar.gz b/tests/pkg/1/build2.org/common/bar/testing/libbar-1.1.0.tar.gz deleted file mode 100644 index f081804..0000000 Binary files a/tests/pkg/1/build2.org/common/bar/testing/libbar-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/bar/testing/repositories b/tests/pkg/1/build2.org/common/bar/testing/repositories deleted file mode 100644 index 5ab8cba..0000000 --- a/tests/pkg/1/build2.org/common/bar/testing/repositories +++ /dev/null @@ -1,8 +0,0 @@ -# bar/testing -# -: 1 -location: ../../foo/testing -: -location: ../stable -role: complement -: diff --git a/tests/pkg/1/build2.org/common/bar/unstable/libbar-1.1.1.tar.gz b/tests/pkg/1/build2.org/common/bar/unstable/libbar-1.1.1.tar.gz deleted file mode 100644 index a0fbdc3..0000000 Binary files a/tests/pkg/1/build2.org/common/bar/unstable/libbar-1.1.1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/bar/unstable/repositories b/tests/pkg/1/build2.org/common/bar/unstable/repositories deleted file mode 100644 index d4ddcf5..0000000 --- a/tests/pkg/1/build2.org/common/bar/unstable/repositories +++ /dev/null @@ -1,8 +0,0 @@ -# bar/unstable -# -: 1 -location: ../../foo/testing -: -location: ../testing -role: complement -: diff --git a/tests/pkg/1/build2.org/common/foo/stable/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/common/foo/stable/libfoo-1.0.0.tar.gz deleted file mode 100644 index c29dd9d..0000000 Binary files a/tests/pkg/1/build2.org/common/foo/stable/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/foo/stable/repositories b/tests/pkg/1/build2.org/common/foo/stable/repositories deleted file mode 100644 index 13673fb..0000000 --- a/tests/pkg/1/build2.org/common/foo/stable/repositories +++ /dev/null @@ -1,3 +0,0 @@ -# foo/stable -# -: 1 diff --git a/tests/pkg/1/build2.org/common/foo/testing/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/common/foo/testing/libfoo-1.1.0.tar.gz deleted file mode 100644 index a6c0202..0000000 Binary files a/tests/pkg/1/build2.org/common/foo/testing/libfoo-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/foo/testing/repositories b/tests/pkg/1/build2.org/common/foo/testing/repositories deleted file mode 100644 index cd33f88..0000000 --- a/tests/pkg/1/build2.org/common/foo/testing/repositories +++ /dev/null @@ -1,6 +0,0 @@ -# foo/testing -# -: 1 -location: ../stable -role: complement -: diff --git a/tests/pkg/1/build2.org/common/hello/libhello-1.0.0.tar.gz b/tests/pkg/1/build2.org/common/hello/libhello-1.0.0.tar.gz deleted file mode 100644 index e9d9ff1..0000000 Binary files a/tests/pkg/1/build2.org/common/hello/libhello-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/common/hello/repositories b/tests/pkg/1/build2.org/common/hello/repositories deleted file mode 100644 index bbe8a66..0000000 --- a/tests/pkg/1/build2.org/common/hello/repositories +++ /dev/null @@ -1,36 +0,0 @@ -# Hello World repository. Currently does not have any prerequisite -# repositories. -# -: 1 -certificate: \ ------BEGIN CERTIFICATE----- -MIIFLzCCAxegAwIBAgIJAK41T2Si9cMEMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV -BAoTDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDEw9uYW1lOmJ1aWxkMi5vcmcwHhcN -MTYwNDMwMTQyNDQ3WhcNMTcwNDMwMTQyNDQ3WjAzMRcwFQYDVQQKEw5Db2RlIFN5 -bnRoZXNpczEYMBYGA1UEAxMPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ -IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP -PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH -4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN -CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H -Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl -QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu -bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a -I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ -u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa -DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU -4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF -BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC -AgEAeBHkz12OPjjFPftCZ8u/9Kq+W0ZnqQqXmSLj5SQFiG5PEUSV19XFcGawwjbU -6guceUSHhHQr/KhpV02pyoPPtskdognHQCPr6HCR6eeEtfBUSum5dKpJAWqGhszg -bPCb11/ksBBzpBbc/C+gnU8ZvsglJ/wxrizZ0AYeSdvyWq8pgoh2vGpgdhK5MWhd -rVGQm+TUVmXyQwNrYDjqhoGZF02UilIekedegWUEvkXnk5rzyzTaX+GwlnsplVY2 -Xijn8cWkO4cCDkthyjfNPgUm8ZgKuBgs+OYRbW4XtuXgeBucBVCryrM8+3OSmzbs -IBQWL0EDT7bnt2ukE+cUx8Foc/+180KZAdDbUY9MOsYCac3bXnIJd/q1pzkr+OvL -EXnuIGuzUqVkcD4+ABaWefNUm3KeZwBAupYc9eo2/YzpCUsgAe0PAdgJhcg9D4kX -2RwwjVpOPWUxevrPq32Lo3R8obfl2aCLzcuiuheb1EcJLlAH67KqdXLDpvZqJ9qi -iaBCixRl2t3our5VSBWQQefGnH6DWn1JM34zyBbeZdgjyqebSN42p+hADYe2qzdf -AviHJsBwvt3HYpr3bfU6EDx1cU5D6gNAxzZMkZhnEQ7u6kXDcLyWJhgXcZhGT0xv -D/x+fIGI1t2XkoOmvuno1MqoDQX3sCYd0bfB/9wwzcNexic= ------END CERTIFICATE----- -\ diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/INSTALL b/tests/pkg/1/build2.org/common/libhello-1.0.0/INSTALL deleted file mode 100644 index 485b10f..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/INSTALL +++ /dev/null @@ -1 +0,0 @@ -Just use build2, bro. diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/bootstrap.build b/tests/pkg/1/build2.org/common/libhello-1.0.0/build/bootstrap.build deleted file mode 100644 index 8d8db2b..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/bootstrap.build +++ /dev/null @@ -1,22 +0,0 @@ -project = libhello - -using build@0.4.0-a1 - -version = 1.0.0 - -abi_major = 1 -abi_minor = 0 -abi_patch = 0 -abi_prerelease = false - -revision = 0 - -dist.package = $project-$version - -if ($revision != 0) - dist.package += +$revision - -using config -using dist -using test -using install diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/export.build b/tests/pkg/1/build2.org/common/libhello-1.0.0/build/export.build deleted file mode 100644 index 1eb73b7..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/export.build +++ /dev/null @@ -1,6 +0,0 @@ -$out_root/: -{ - include hello/ -} - -export $out_root/hello/lib{hello} diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/root.build b/tests/pkg/1/build2.org/common/libhello-1.0.0/build/root.build deleted file mode 100644 index 4f70114..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/build/root.build +++ /dev/null @@ -1,6 +0,0 @@ -cxx.std = 11 - -using cxx - -hxx{*}: extension = -cxx{*}: extension = cxx diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/buildfile b/tests/pkg/1/build2.org/common/libhello-1.0.0/buildfile deleted file mode 100644 index a416648..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/buildfile +++ /dev/null @@ -1,8 +0,0 @@ -d = hello/ tests/ -./: $d doc{INSTALL version} file{manifest} -include $d - -# Don't install tests or the INSTALL file. -# -dir{tests/}: install = false -doc{INSTALL}@./: install = false diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/buildfile b/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/buildfile deleted file mode 100644 index bff7fce..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/buildfile +++ /dev/null @@ -1,21 +0,0 @@ -lib{hello}: {hxx cxx}{hello} hxx{export} - -# For pre-releases use the complete version to make sure they cannot be used -# in place of another pre-release or the final version. -# -if $abi_prerelease - lib{hello}: bin.lib.version = @-$version -else - lib{hello}: bin.lib.version = @-$abi_major.$abi_minor - -cxx.poptions += "-I$src_root" -obja{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD -objs{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD - -lib{hello}: cxx.export.poptions = "-I$src_root" -liba{hello}: cxx.export.poptions += -DLIBHELLO_STATIC -libs{hello}: cxx.export.poptions += -DLIBHELLO_SHARED - -# Install into the hello/ subdirectory of, say, /usr/include/. -# -install.include = $install.include/hello/ diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/export b/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/export deleted file mode 100644 index 18f4968..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/export +++ /dev/null @@ -1,36 +0,0 @@ -// file: hello/export -*- C++ -*- - -#pragma once - -// Normally we don't export class templates (but do complete specializations), -// inline functions, and classes with only inline member functions. Exporting -// classes that inherit from non-exported/imported bases (e.g., std::string) -// will end up badly. The only known workarounds are to not inherit or to not -// export. Also, MinGW GCC doesn't like seeing non-exported function being -// used before their inline definition. The workaround is to reorder code. In -// the end it's all trial and error. - -#if defined(LIBHELLO_STATIC) // Using static. -# define LIBHELLO_EXPORT -#elif defined(LIBHELLO_STATIC_BUILD) // Building static. -# define LIBHELLO_EXPORT -#elif defined(LIBHELLO_SHARED) // Using shared. -# ifdef _WIN32 -# define LIBHELLO_EXPORT __declspec(dllimport) -# else -# define LIBHELLO_EXPORT -# endif -#elif defined(LIBHELLO_SHARED_BUILD) // Building shared. -# ifdef _WIN32 -# define LIBHELLO_EXPORT __declspec(dllexport) -# else -# define LIBHELLO_EXPORT -# endif -#else -// If none of the above macros are defined, then we assume we are being used -// by some third-party build system that cannot/doesn't signal the library -// type. Note that this fallback works for both static and shared but in case -// of shared will be sub-optimal compared to having dllimport. -// -# define LIBHELLO_EXPORT // Using static or shared. -#endif diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello b/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello deleted file mode 100644 index 5fb7d9e..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello +++ /dev/null @@ -1,13 +0,0 @@ -// file: hello/hello -*- C++ -*- - -#pragma once - -#include - -#include - -namespace hello -{ - LIBHELLO_EXPORT void - say (const std::string& name); -} diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello.cxx b/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello.cxx deleted file mode 100644 index 65d0aa7..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/hello/hello.cxx +++ /dev/null @@ -1,16 +0,0 @@ -// file: hello/hello.cxx -*- C++ -*- - -#include - -#include - -using namespace std; - -namespace hello -{ - void - say (const string& n) - { - cout << "Hello, " << n << '!' << endl; - } -} diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/manifest b/tests/pkg/1/build2.org/common/libhello-1.0.0/manifest deleted file mode 100644 index 75dc91b..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/manifest +++ /dev/null @@ -1,14 +0,0 @@ -: 1 -name: libhello -version: 1.0.0 -summary: The "Hello World" example library -license: MIT -tags: c++, hello, world, example -description: \ -A simple library that implements the "Hello World" example in C++. Its primary -goal is to show a canonical build2/bpkg project/package. -\ -url: http://www.example.org/libhello -email: hello-users@example.org -requires: c++11 -requires: build2 >= 0.4.0 diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/bootstrap.build b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/bootstrap.build deleted file mode 100644 index 2c2de24..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/bootstrap.build +++ /dev/null @@ -1,5 +0,0 @@ -project = # Unnamed subproject. - -using config -using dist -using test diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/root.build b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/root.build deleted file mode 100644 index de723b8..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/build/root.build +++ /dev/null @@ -1,14 +0,0 @@ -cxx.std = 11 - -using cxx - -hxx{*}: extension = -cxx{*}: extension = cxx - -# Every exe{} in this subproject is by default a test. -# -exe{*}: test = true - -# Specify the test target for cross-testing. -# -test.target = $cxx.target diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/buildfile b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/buildfile deleted file mode 100644 index 4dcbe2a..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -d = test/ -./: $d -include $d diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/buildfile b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/buildfile deleted file mode 100644 index a46969d..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/buildfile +++ /dev/null @@ -1,4 +0,0 @@ -import libs = libhello%lib{hello} - -exe{driver}: cxx{driver} $libs -exe{driver}: test.output = test.out diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/driver.cxx b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/driver.cxx deleted file mode 100644 index 59bfb2d..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/driver.cxx +++ /dev/null @@ -1,11 +0,0 @@ -// file: tests/test/driver.cxx -*- C++ -*- - -#include - -int -main () -{ - using hello::say; - - say ("World"); -} diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/test.out b/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/test.out deleted file mode 100644 index 8ab686e..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/tests/test/test.out +++ /dev/null @@ -1 +0,0 @@ -Hello, World! diff --git a/tests/pkg/1/build2.org/common/libhello-1.0.0/version b/tests/pkg/1/build2.org/common/libhello-1.0.0/version deleted file mode 100644 index 3eefcb9..0000000 --- a/tests/pkg/1/build2.org/common/libhello-1.0.0/version +++ /dev/null @@ -1 +0,0 @@ -1.0.0 diff --git a/tests/pkg/1/build2.org/common/not-a-package.tar.gz b/tests/pkg/1/build2.org/common/not-a-package.tar.gz deleted file mode 100644 index aa10905..0000000 Binary files a/tests/pkg/1/build2.org/common/not-a-package.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libbar-1.0.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libbar-1.0.0.tar.gz deleted file mode 100644 index 0ae6e26..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libbar-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libbar-1.1.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libbar-1.1.0.tar.gz deleted file mode 100644 index 39dbdf4..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libbar-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libbar-1.2.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libbar-1.2.0.tar.gz deleted file mode 100644 index 3a034ff..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libbar-1.2.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libbar-1.3.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libbar-1.3.0.tar.gz deleted file mode 100644 index 19d5a6f..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libbar-1.3.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libfoo-1.0.0.tar.gz deleted file mode 100644 index 28a6a90..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libfoo-1.1.0.tar.gz deleted file mode 100644 index e03481f..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libfoo-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/libfoo-1.2.0.tar.gz b/tests/pkg/1/build2.org/depend/stable/libfoo-1.2.0.tar.gz deleted file mode 100644 index aad6906..0000000 Binary files a/tests/pkg/1/build2.org/depend/stable/libfoo-1.2.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/depend/stable/repositories b/tests/pkg/1/build2.org/depend/stable/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/depend/stable/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz deleted file mode 100644 index 28a6a90..0000000 Binary files a/tests/pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/fetch/libfoo-1.1.0.tar.gz deleted file mode 100644 index e03481f..0000000 Binary files a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/build/bootstrap.build b/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/build/bootstrap.build deleted file mode 100644 index 54f267e..0000000 --- a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = fetch-libfoo -using config diff --git a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/buildfile b/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/buildfile deleted file mode 100644 index 9f80de9..0000000 --- a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/buildfile +++ /dev/null @@ -1 +0,0 @@ -./: diff --git a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/manifest b/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/manifest deleted file mode 100644 index 3453757..0000000 --- a/tests/pkg/1/build2.org/fetch/libfoo-1.1.0/manifest +++ /dev/null @@ -1,7 +0,0 @@ -: 1 -name: libfoo -version: 1.1.0 -summary: libfoo -license: MIT -url: http://example.org -email: pkg@example.org diff --git a/tests/pkg/1/build2.org/fetch/repositories b/tests/pkg/1/build2.org/fetch/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/fetch/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/fetch/t1/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/fetch/t1/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/fetch/t1/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/fetch/t1/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/fetch/t1/libfoo-1.1.0.tar.gz deleted file mode 120000 index c004b2a..0000000 --- a/tests/pkg/1/build2.org/fetch/t1/libfoo-1.1.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/fetch/t1/repositories b/tests/pkg/1/build2.org/fetch/t1/repositories deleted file mode 120000 index d965b15..0000000 --- a/tests/pkg/1/build2.org/fetch/t1/repositories +++ /dev/null @@ -1 +0,0 @@ -../repositories \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/libbar-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbar-1.0.0.tar.gz deleted file mode 100644 index 5dc3a9b..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbar-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libbar-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbar-1.1.0.tar.gz deleted file mode 100644 index 881292e..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbar-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libbar-1.2.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbar-1.2.0.tar.gz deleted file mode 100644 index 4572395..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbar-1.2.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libbaz-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbaz-1.0.0.tar.gz deleted file mode 100644 index 1de32b2..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbaz-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libbaz-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbaz-1.1.0.tar.gz deleted file mode 100644 index 1aa72a8..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbaz-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libbiz-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libbiz-1.0.0.tar.gz deleted file mode 100644 index 42e3db4..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libbiz-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz b/tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz deleted file mode 100644 index 2ab5094..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libfoo-1.0.0.tar.gz deleted file mode 100644 index 28a6a90..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz deleted file mode 100644 index e03481f..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/build/bootstrap.build b/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/build/bootstrap.build deleted file mode 100644 index b24ee6a..0000000 --- a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = satisfy-libfoo -using config diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/buildfile b/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/buildfile deleted file mode 100644 index 9f80de9..0000000 --- a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/buildfile +++ /dev/null @@ -1 +0,0 @@ -./: diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/manifest b/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/manifest deleted file mode 100644 index 3453757..0000000 --- a/tests/pkg/1/build2.org/satisfy/libfoo-1.1.0/manifest +++ /dev/null @@ -1,7 +0,0 @@ -: 1 -name: libfoo -version: 1.1.0 -summary: libfoo -license: MIT -url: http://example.org -email: pkg@example.org diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-1.2.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libfoo-1.2.0.tar.gz deleted file mode 100644 index 80ce03b..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfoo-1.2.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/libfox-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libfox-1.0.0.tar.gz deleted file mode 100644 index 9ba7a31..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfox-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/satisfy/repositories b/tests/pkg/1/build2.org/satisfy/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/satisfy/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/satisfy/t1/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t1/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/satisfy/t1/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t1/repositories b/tests/pkg/1/build2.org/satisfy/t1/repositories deleted file mode 120000 index d965b15..0000000 --- a/tests/pkg/1/build2.org/satisfy/t1/repositories +++ /dev/null @@ -1 +0,0 @@ -../repositories \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t2/libbar-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t2/libbar-1.0.0.tar.gz deleted file mode 120000 index 93e8c71..0000000 --- a/tests/pkg/1/build2.org/satisfy/t2/libbar-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t2/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t2/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/satisfy/t2/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t2/repositories b/tests/pkg/1/build2.org/satisfy/t2/repositories deleted file mode 120000 index d965b15..0000000 --- a/tests/pkg/1/build2.org/satisfy/t2/repositories +++ /dev/null @@ -1 +0,0 @@ -../repositories \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t3/libbaz-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t3/libbaz-1.0.0.tar.gz deleted file mode 120000 index 189242a..0000000 --- a/tests/pkg/1/build2.org/satisfy/t3/libbaz-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbaz-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t3/libfox-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t3/libfox-1.0.0.tar.gz deleted file mode 120000 index dcfd7aa..0000000 --- a/tests/pkg/1/build2.org/satisfy/t3/libfox-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfox-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t3/repositories b/tests/pkg/1/build2.org/satisfy/t3/repositories deleted file mode 100644 index d65b272..0000000 --- a/tests/pkg/1/build2.org/satisfy/t3/repositories +++ /dev/null @@ -1,4 +0,0 @@ -: 1 -location: ../t2 -: - diff --git a/tests/pkg/1/build2.org/satisfy/t4a/libfoo-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4a/libfoo-1.1.0.tar.gz deleted file mode 120000 index c004b2a..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4a/libfoo-1.1.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4a/repositories b/tests/pkg/1/build2.org/satisfy/t4a/repositories deleted file mode 120000 index d965b15..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4a/repositories +++ /dev/null @@ -1 +0,0 @@ -../repositories \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4b/libbar-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4b/libbar-1.1.0.tar.gz deleted file mode 120000 index b9a2de5..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4b/libbar-1.1.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4b/repositories b/tests/pkg/1/build2.org/satisfy/t4b/repositories deleted file mode 100644 index 7b85e71..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4b/repositories +++ /dev/null @@ -1,3 +0,0 @@ -: 1 -location: ../t4a -: diff --git a/tests/pkg/1/build2.org/satisfy/t4c/libbaz-1.1.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4c/libbaz-1.1.0.tar.gz deleted file mode 120000 index 0edbce7..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4c/libbaz-1.1.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbaz-1.1.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4c/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4c/libfoo-1.0.0.tar.gz deleted file mode 120000 index 32e5a3c..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4c/libfoo-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfoo-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4c/repositories b/tests/pkg/1/build2.org/satisfy/t4c/repositories deleted file mode 100644 index 26c0e93..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4c/repositories +++ /dev/null @@ -1,3 +0,0 @@ -: 1 -location: ../t4b -: diff --git a/tests/pkg/1/build2.org/satisfy/t4d/libbiz-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4d/libbiz-1.0.0.tar.gz deleted file mode 120000 index 70c2fda..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4d/libbiz-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbiz-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4d/libfox-1.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t4d/libfox-1.0.0.tar.gz deleted file mode 120000 index dcfd7aa..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4d/libfox-1.0.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libfox-1.0.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t4d/repositories b/tests/pkg/1/build2.org/satisfy/t4d/repositories deleted file mode 100644 index f0e1983..0000000 --- a/tests/pkg/1/build2.org/satisfy/t4d/repositories +++ /dev/null @@ -1,3 +0,0 @@ -: 1 -location: ../t4c -: diff --git a/tests/pkg/1/build2.org/satisfy/t5/libbar-1.2.0.tar.gz b/tests/pkg/1/build2.org/satisfy/t5/libbar-1.2.0.tar.gz deleted file mode 120000 index b4a7773..0000000 --- a/tests/pkg/1/build2.org/satisfy/t5/libbar-1.2.0.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-1.2.0.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/satisfy/t5/repositories b/tests/pkg/1/build2.org/satisfy/t5/repositories deleted file mode 120000 index d965b15..0000000 --- a/tests/pkg/1/build2.org/satisfy/t5/repositories +++ /dev/null @@ -1 +0,0 @@ -../repositories \ No newline at end of file diff --git a/tests/pkg/1/build2.org/status/extra/libbar-1.1.0+1.tar.gz b/tests/pkg/1/build2.org/status/extra/libbar-1.1.0+1.tar.gz deleted file mode 100644 index 890e9e2..0000000 Binary files a/tests/pkg/1/build2.org/status/extra/libbar-1.1.0+1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/extra/repositories b/tests/pkg/1/build2.org/status/extra/repositories deleted file mode 100644 index ecaa454..0000000 --- a/tests/pkg/1/build2.org/status/extra/repositories +++ /dev/null @@ -1,3 +0,0 @@ -: 1 -location: ../stable -: diff --git a/tests/pkg/1/build2.org/status/stable/libbar-1.0.0.tar.gz b/tests/pkg/1/build2.org/status/stable/libbar-1.0.0.tar.gz deleted file mode 100644 index 97e6e32..0000000 Binary files a/tests/pkg/1/build2.org/status/stable/libbar-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/stable/libfoo-1.0.0.tar.gz b/tests/pkg/1/build2.org/status/stable/libfoo-1.0.0.tar.gz deleted file mode 100644 index 5e7fa17..0000000 Binary files a/tests/pkg/1/build2.org/status/stable/libfoo-1.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/stable/repositories b/tests/pkg/1/build2.org/status/stable/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/status/stable/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/status/testing/libbar-1.0.0+1.tar.gz b/tests/pkg/1/build2.org/status/testing/libbar-1.0.0+1.tar.gz deleted file mode 100644 index 5794085..0000000 Binary files a/tests/pkg/1/build2.org/status/testing/libbar-1.0.0+1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/testing/libbar-1.1.0.tar.gz b/tests/pkg/1/build2.org/status/testing/libbar-1.1.0.tar.gz deleted file mode 100644 index b01ac44..0000000 Binary files a/tests/pkg/1/build2.org/status/testing/libbar-1.1.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/testing/repositories b/tests/pkg/1/build2.org/status/testing/repositories deleted file mode 100644 index 7bd7269..0000000 --- a/tests/pkg/1/build2.org/status/testing/repositories +++ /dev/null @@ -1,6 +0,0 @@ -: 1 -location: ../stable -role: complement -: -location: ../extra -: diff --git a/tests/pkg/1/build2.org/status/unstable/libbar-2.0.0.tar.gz b/tests/pkg/1/build2.org/status/unstable/libbar-2.0.0.tar.gz deleted file mode 100644 index 6cc5890..0000000 Binary files a/tests/pkg/1/build2.org/status/unstable/libbar-2.0.0.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/status/unstable/repositories b/tests/pkg/1/build2.org/status/unstable/repositories deleted file mode 100644 index 8f4a5f6..0000000 --- a/tests/pkg/1/build2.org/status/unstable/repositories +++ /dev/null @@ -1,4 +0,0 @@ -: 1 -location: ../testing -role: complement -: diff --git a/tests/pkg/1/build2.org/system/foo-2.tar.gz b/tests/pkg/1/build2.org/system/foo-2.tar.gz deleted file mode 100644 index 7fef159..0000000 Binary files a/tests/pkg/1/build2.org/system/foo-2.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/system/libbar-0+1.tar.gz b/tests/pkg/1/build2.org/system/libbar-0+1.tar.gz deleted file mode 100644 index 9f90936..0000000 Binary files a/tests/pkg/1/build2.org/system/libbar-0+1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/system/libbar-1.tar.gz b/tests/pkg/1/build2.org/system/libbar-1.tar.gz deleted file mode 100644 index 4b52278..0000000 Binary files a/tests/pkg/1/build2.org/system/libbar-1.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/system/libbar-2.tar.gz b/tests/pkg/1/build2.org/system/libbar-2.tar.gz deleted file mode 100644 index 28ad509..0000000 Binary files a/tests/pkg/1/build2.org/system/libbar-2.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/system/libbaz-2.tar.gz b/tests/pkg/1/build2.org/system/libbaz-2.tar.gz deleted file mode 100644 index 3e9c3e6..0000000 Binary files a/tests/pkg/1/build2.org/system/libbaz-2.tar.gz and /dev/null differ diff --git a/tests/pkg/1/build2.org/system/t1/foo-2.tar.gz b/tests/pkg/1/build2.org/system/t1/foo-2.tar.gz deleted file mode 120000 index 39d2e10..0000000 --- a/tests/pkg/1/build2.org/system/t1/foo-2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz b/tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz deleted file mode 120000 index 971bed1..0000000 --- a/tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-1.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz b/tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz deleted file mode 120000 index 2c8027b..0000000 --- a/tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-2.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz b/tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz deleted file mode 120000 index 111a2e7..0000000 --- a/tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbaz-2.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t1/repositories b/tests/pkg/1/build2.org/system/t1/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/system/t1/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/system/t2/foo-2.tar.gz b/tests/pkg/1/build2.org/system/t2/foo-2.tar.gz deleted file mode 120000 index 39d2e10..0000000 --- a/tests/pkg/1/build2.org/system/t2/foo-2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz b/tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz deleted file mode 120000 index 82bdcba..0000000 --- a/tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../libbar-0+1.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t2/repositories b/tests/pkg/1/build2.org/system/t2/repositories deleted file mode 100644 index 5b70556..0000000 --- a/tests/pkg/1/build2.org/system/t2/repositories +++ /dev/null @@ -1 +0,0 @@ -: 1 diff --git a/tests/pkg/1/build2.org/system/t3/foo-2.tar.gz b/tests/pkg/1/build2.org/system/t3/foo-2.tar.gz deleted file mode 120000 index 39d2e10..0000000 --- a/tests/pkg/1/build2.org/system/t3/foo-2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../foo-2.tar.gz \ No newline at end of file diff --git a/tests/pkg/1/build2.org/system/t3/repositories b/tests/pkg/1/build2.org/system/t3/repositories deleted file mode 100644 index 2715634..0000000 --- a/tests/pkg/1/build2.org/system/t3/repositories +++ /dev/null @@ -1,3 +0,0 @@ -: 1 -location: ../t2 -: \ No newline at end of file diff --git a/tests/pkg/publish b/tests/pkg/publish deleted file mode 100755 index 00453cc..0000000 --- a/tests/pkg/publish +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# Some commonly useful addtional options that can be specified via the -# command line: -# -# --dry-run -# --progress -# -rsync -v -rlpt --copy-unsafe-links \ ---prune-empty-dirs --delete-after --delete-excluded $* \ ---include '*/' \ ---include '*.tar.gz' \ ---include 'packages' \ ---include 'repositories' \ ---include 'signature' \ ---exclude '*' \ -1/build2.org/ build2.org:/var/pkg/1/ diff --git a/tests/publish b/tests/publish new file mode 100755 index 0000000..3a6b0d8 --- /dev/null +++ b/tests/publish @@ -0,0 +1,17 @@ +#!/bin/sh + +# Some commonly useful addtional options that can be specified via the +# command line: +# +# --dry-run +# --progress +# +rsync -v -rlpt --copy-unsafe-links \ +--prune-empty-dirs --delete-after --delete-excluded $* \ +--include '*/' \ +--include '*.tar.gz' \ +--include 'packages' \ +--include 'repositories' \ +--include 'signature' \ +--exclude '*' \ +test/*/pkg/1/build2.org/ build2.org:/var/pkg/1/ diff --git a/tests/remote.test b/tests/remote.test new file mode 100644 index 0000000..fdd3fbb --- /dev/null +++ b/tests/remote.test @@ -0,0 +1,37 @@ +# file : tests/remote.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Tests for commands that accept repository location must be able to run +# regardless whether the repository is local or remote. They also must be able +# to create the repository used for testing at the specified path, so being +# published to build2.org it can be used for the remote testing. Note that +# prior to publishing repositories tests must be performed with the +# config.test.output=keep variable override, so their working directories (that +# contain repositories produced) are not cleaned up. +# + +# Output directory path that testscripts must use to prepare repositories +# required by tests they contains. +# +# Note that the local path is carefully crafted so that we end up with the +# same repository names in both (local and remote) cases. This is necessary +# for the authentication to work properly in both cases. +# +out = $canonicalize([dir_path] $~/pkg/1/build2.org/) + +# If $remote is true then remote repositories locations must be used for +# tests. Variables rep_root and rep refer to the root and the command- +# specific repositories respectively. Note that the variables type is dir_path +# for local repositories (rather than string for the remote ones), that allows +# to portably obtain sub-repositories locations representations. +# +remote = $config.bpkg.test.remote +rep_root = ($remote == true ? [string] "https://build2.org/bpkg/1" : $out) + +out += [dir_path] $cmd +rep = ($remote == true ? [string] "$rep_root/$cmd" : $out) + ++if ($remote != true) + mkdir -p $out +end diff --git a/tests/rep-add.test b/tests/rep-add.test new file mode 100644 index 0000000..a1b9104 --- /dev/null +++ b/tests/rep-add.test @@ -0,0 +1,70 @@ +# file : tests/rep-add.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test + +: location +: +{ + : none + : + $* 2>>EOE != 0 + error: repository location argument expected + info: run 'bpkg help rep-add' for more information + EOE + + : no-version + : + $* 'stable' 2>>EOE != 0 + error: invalid repository location 'stable': missing repository version + EOE + + : invalid-host + : + $* 'http://' 2>>EOE != 0 + error: invalid repository location 'http://': invalid host + EOE +} + +: relative-path +: +{ + $clone_cfg; + + $* ./1/bar/stable 2>>/~%EOE%; + %added repository .+/relative-path/bar/stable% + EOE + + $* ./1/../1/bar/stable 2>>/~%EOE% != 0 + %error: .+/relative-path/bar/stable is already a repository of this configuration% + EOE +} + +: absolute-path +: +{ + $clone_cfg; + + $* $~/1/foo/stable 2>>/~%EOE%; + %added repository .+/absolute-path/foo/stable% + EOE + + $* $~/1/../1/foo/stable 2>>/~%EOE% != 0 + %error: .+/absolute-path/foo/stable is already a repository of this configuration% + EOE +} + +: remote-url +: +{ + $clone_cfg; + + $* 'http://pkg.example.org/1/testing' 2>>~%EOE%; + %added repository example.org/testing% + EOE + + $* 'https://www.example.org/1/testing' 2>>~%EOE% != 0 + %error: example.org/testing is already a repository of this configuration% + EOE +} diff --git a/tests/rep-auth.test b/tests/rep-auth.test new file mode 100644 index 0000000..80e98de --- /dev/null +++ b/tests/rep-auth.test @@ -0,0 +1,469 @@ +# file : tests/rep-auth.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# There is no rep-auth command, and this testscript contains tests for various +# authentication scenarios throughout different stages of repositories +# preparation and consumption. Note that by that reason usage of $* is +# meaningless. +# + +# Source repository: +# +# rep-auth +# |-- expired +# | |-- foo-1.tar.gz +# | |-- packages +# | |-- repositories +# | `-- signature +# `-- unsigned +# |-- foo-1.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rc = $rep_create 2>- + + # Create the 'unsigned1' repository. + # + cp -r $src/unsigned $out/unsigned1 + $rc $out/unsigned1 &$out/unsigned1/packages + + # Create the 'unsigned2' repository. This is a copy of the just created + # 'unsigned1' repository. + # + cp -r $out/unsigned1 $out/unsigned2 + + # Create the 'signed' repository. + # + cp -r $src/unsigned $out/signed + cat <<<$cert_manifest >+$out/signed/repositories + $rc --key $key $out/signed &$out/signed/packages &$out/signed/signature + + # Create the 'name-mismatch' repository. Note that its certificate name + # mismatches the repository location. + # + cp -r $src/unsigned $out/name-mismatch + + echo 'certificate: \' >+$out/name-mismatch/repositories + cat <<<$src_base/auth/mismatch-cert.pem >+$out/name-mismatch/repositories + echo '\' >+$out/name-mismatch/repositories + + $rc --key $key $out/name-mismatch &$out/name-mismatch/packages \ + &$out/name-mismatch/signature + + # Create the 'expired' repository. This repository is "pre-created" and its + # certificate is expired by now. So we just copy it from the source + # directory. + # + cp -r $src/expired $out/expired + + # Create the 'sha256sum-mismatch' repository. This is a copy of the just + # created 'signed' repository that has the sha256sum manifest value tampered. + # + cp -r $out/signed $out/sha256sum-mismatch + + v = 'd374c59b36fdbdbd0d4468665061d94fda9c6c687863dfe72b0bcc34ff9d5fb4' + sed -i -e "s/^\(sha256sum: \).*\$/\\1$v/" $out/sha256sum-mismatch/signature + + # Create the 'signature-mismatch' repository. This is a copy of the just + # created 'signed' repository that has the signature manifest value tampered. + # + cp -r $out/signed $out/signature-mismatch + + # Here we tamper the last signature line (the one of 76 chars length, without + # spaces and terminated with '='). + # + v = 'mnBAsS529NUdNIQy8EB4si/UK26ICaMywbLeHDVvWOB+AsqZ5rj8VjGDamLbmUrDr3ru7BU1gJU=' + sed -i -e "s%^[^ ]{75}=\$%$v%" $out/signature-mismatch/signature +end + +pkg_status += -d cfg +rep_add += -d cfg 2>- +rep_fetch += -d cfg + +# Check if rep-fetch command was successfull or not. +# +fetched = $pkg_status foo >'available 1 sys:?' +not_fetched = $pkg_status foo >'unknown' + +sc = " " # Space character to append to here-document line when required. + +: no-auth +: +: Test that local repositories do not require authentication by default. +: +{ + r = 1/signed + +mkdir 1/ + +cp -r $src/unsigned $r + +cat <<<$cert_manifest >+$r/repositories + +$rep_create --key $key $r &$r/packages &$r/signature 2>- + + : rep-fetch + : + { + $clone_root_cfg && $rep_add ../$r; + + $rep_fetch 2>>/~%EOE% + %fetching .+/no-auth/signed% + 1 package(s) in 1 repository(s) + EOE + } + + : rep-info + : + $clone_root_cfg; + $rep_info --cert-name ../$r >'name:build2.org' +} + +: signed +: +{ + : rep-fetch + : + { + +$clone_root_cfg && $rep_add $rep/signed + rep_fetch += --auth all &?cfg/.bpkg/certs/*** + + : no-auth + : + { + $clone_cfg; + + $rep_fetch 2>>"EOE" != 0; + fetching build2.org/rep-auth/signed + warning: authenticity of the certificate for repository build2.org/rep-auth/signed cannot be established + certificate is for build2.org, "Code Synthesis" + certificate SHA256 fingerprint: + $cert_fp + trust this certificate? [y/n]$sc + error: unable to read y/n answer from STDOUT + EOE + + $not_fetched + } + + : trust-fp + : + { + $clone_cfg; + + $rep_fetch --trust $cert_fp 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $fetched + } + + : trust-fp-no + : + { + $clone_cfg; + + $rep_fetch --trust-no --trust $cert_fp 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $fetched + } + + : trust-yes + : + { + $clone_cfg; + + $rep_fetch --trust-yes 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $fetched + } + + : trust-no + : + { + $clone_cfg; + + $rep_fetch --trust-no 2>>EOE != 0; + fetching build2.org/rep-auth/signed + error: authenticity of the certificate for repository build2.org/rep-auth/signed cannot be established + EOE + + $not_fetched + } + + : trust-yes-no + : + { + $clone_cfg; + + $rep_fetch --trust-yes --trust-no 2>>EOE != 0; + fetching build2.org/rep-auth/signed + error: --trust-yes and --trust-no are mutually exclusive + EOE + + $not_fetched + } + + : already-trusted + : + { + $clone_cfg; + + $rep_fetch --trust-yes 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $rep_fetch 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $fetched; + + $rep_fetch --trust-no 2>>EOE; + fetching build2.org/rep-auth/signed + 1 package(s) in 1 repository(s) + EOE + + $fetched + } + } + + : rep-info + : + { + rep_info += --cert-name --auth all $rep/signed + + : no-auth + : + $rep_info 2>>"EOE" != 0 + warning: authenticity of the certificate for repository build2.org/rep-auth/signed cannot be established + certificate is for build2.org, "Code Synthesis" + certificate SHA256 fingerprint: + $cert_fp + trust this certificate? [y/n]$sc + error: unable to read y/n answer from STDOUT + EOE + + : trust-fp + : + $rep_info --trust $cert_fp >'name:build2.org' + + : trust-yes + : + $rep_info --trust-yes >'name:build2.org' + + : trust-no + : + $rep_info --trust-no 2>>EOE != 0 + error: authenticity of the certificate for repository build2.org/rep-auth/signed cannot be established + EOE + + : already-trusted + : + { + $clone_root_cfg; + rep_info += -d cfg; + + $rep_info --trust "$cert_fp" &cfg/.bpkg/certs/*** >'name:build2.org'; + $rep_info >'name:build2.org' + } + } +} + +: unsigned +: +{ + : rep-fetch + : + { + +$clone_root_cfg && $rep_add $rep/unsigned1 + rep_fetch += --auth all + + : no-auth + : + { + $clone_cfg; + + $rep_fetch 2>>~%EOE% != 0; + fetching build2.org/rep-auth/unsigned1 + warning: repository build2.org/rep-auth/unsigned1 is unsigned + %continue without authenticating repositories at .+\? \[y/n\] % + error: unable to read y/n answer from STDOUT + EOE + + $not_fetched + } + + : trust-yes + : + { + $clone_cfg; + + $rep_fetch --trust-yes 2>>EOE; + fetching build2.org/rep-auth/unsigned1 + 1 package(s) in 1 repository(s) + EOE + + $fetched + } + + : trust-no + : + { + $clone_cfg; + + $rep_fetch --trust-no 2>>EOE != 0; + fetching build2.org/rep-auth/unsigned1 + error: repository build2.org/rep-auth/unsigned1 is unsigned + EOE + + $not_fetched + } + + : already-trusted + : + { + $clone_cfg; + + $rep_fetch --trust-yes 2>>EOE; + fetching build2.org/rep-auth/unsigned1 + 1 package(s) in 1 repository(s) + EOE + + $rep_fetch 2>>EOE; + fetching build2.org/rep-auth/unsigned1 + 1 package(s) in 1 repository(s) + EOE + + $fetched; + + $rep_fetch --trust-no 2>>EOE; + fetching build2.org/rep-auth/unsigned1 + 1 package(s) in 1 repository(s) + EOE + + $fetched; + + $rep_add $rep/unsigned2; + + $rep_fetch 2>>EOE; + fetching build2.org/rep-auth/unsigned1 + fetching build2.org/rep-auth/unsigned2 + 1 package(s) in 2 repository(s) + EOE + + $fetched + } + } + + : rep-info + : + { + rep_info += --name --auth all $rep/unsigned1 + + : no-auth + : + $rep_info 2>>~%EOE% != 0 + warning: repository build2.org/rep-auth/unsigned1 is unsigned + %continue without authenticating repositories at .+\? \[y/n\] % + error: unable to read y/n answer from STDOUT + EOE + + : trust-yes + : + $rep_info --trust-yes >"build2.org/rep-auth/unsigned1 ($rep/unsigned1)" + + : trust-no + : + $rep_info --trust-no 2>>EOE != 0 + error: repository build2.org/rep-auth/unsigned1 is unsigned + EOE + + : already-trusted + : + { + $clone_root_cfg; + rep_info += -d cfg; + + $rep_info --trust-yes >"build2.org/rep-auth/unsigned1 ($rep/unsigned1)"; + $rep_info >"build2.org/rep-auth/unsigned1 ($rep/unsigned1)" + } + } +} + +: faulty +: +{ + rep_info += --auth all --trust-yes + + : name-mismatch + : + $rep_info $rep/name-mismatch 2>>EOE != 0 + error: certificate name mismatch for repository build2.org/rep-auth/name-mismatch + info: certificate name is build2.org/mismatched/name + EOE + + : expired + : + $rep_info $rep/expired 2>>EOE != 0 + error: certificate for repository build2.org/rep-auth/expired has expired + EOE + + : sha256sum-mismatch + : + $rep_info $rep/sha256sum-mismatch 2>>EOE != 0 + error: packages manifest file checksum mismatch for build2.org/rep-auth/sha256sum-mismatch + info: try again + EOE + + : signature-mismatch + : + $rep_info $rep/signature-mismatch 2>>~%EOE% != 0 + %.* + %error: unable to authenticate repository build2.org/rep-auth/signature-mismatch% + EOE + + : create-rep + : + { + : no-email + : + { + cp -r $src/unsigned rep; + + echo 'certificate: \' >+rep/repositories; + cat <<<$src_base/auth/noemail-cert.pem >+rep/repositories; + echo '\' >+rep/repositories; + + $rep_create --key $key rep &rep/packages 2>>/EOE != 0 + adding foo 1 + error: invalid certificate for rep/: no email + EOE + } + + : expired + : + { + cp -r $src/unsigned rep; + + echo 'certificate: \' >+rep/repositories; + cat <<<$src_base/auth/expired-cert.pem >+rep/repositories; + echo '\' >+rep/repositories; + + $rep_create --key $key rep &rep/packages 2>>/EOE != 0 + adding foo 1 + error: certificate for repository rep/ has expired + EOE + } + } +} diff --git a/tests/rep-auth/expired/foo-1.tar.gz b/tests/rep-auth/expired/foo-1.tar.gz new file mode 120000 index 0000000..d771dc4 --- /dev/null +++ b/tests/rep-auth/expired/foo-1.tar.gz @@ -0,0 +1 @@ +../../common/foo-1.tar.gz \ No newline at end of file diff --git a/tests/rep-auth/expired/packages b/tests/rep-auth/expired/packages new file mode 100644 index 0000000..4fa075a --- /dev/null +++ b/tests/rep-auth/expired/packages @@ -0,0 +1,11 @@ +: 1 +sha256sum: dbeea68d374f6ca66b5f65652e26a0d8324d3fe118341ac470c07214ceb34b60 +: +name: foo +version: 1 +summary: The "Foo" utility +license: MIT +url: http://www.example.org/foo +email: foo-users@example.org +location: foo-1.tar.gz +sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e diff --git a/tests/rep-auth/expired/repositories b/tests/rep-auth/expired/repositories new file mode 100644 index 0000000..7e68ee8 --- /dev/null +++ b/tests/rep-auth/expired/repositories @@ -0,0 +1,33 @@ +: 1 +certificate: \ +-----BEGIN CERTIFICATE----- +MIIFLzCCAxegAwIBAgIJAOx1KvcHxv3GMA0GCSqGSIb3DQEBCwUAMDMxFzAVBgNV +BAoMDkNvZGUgU3ludGhlc2lzMRgwFgYDVQQDDA9uYW1lOmJ1aWxkMi5vcmcwHhcN +MTcwMzAxMTcwMTI0WhcNMTcwMzAyMTcwMTI0WjAzMRcwFQYDVQQKDA5Db2RlIFN5 +bnRoZXNpczEYMBYGA1UEAwwPbmFtZTpidWlsZDIub3JnMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA2rvxJe7MXMIygVTVGfMR4B/MTRRRgbKdLcXaUbu+ +IfdyjGMu34GsUG51WzhcNOmNdLX2FHEiiESAPvVbWOEO+ZQL3IIxbXc8IgiNEpNP +PR58SFNwwd2E6C8pmyN7QhXuy+gpVdwbsN9RWXnXBY9A9JtSt+xBuxeDs/PkdoPH +4O3aL2HB0TUzTPhHZ23BCSzMXIIqJfxEX2g9eKtPPkRMsLd/X0lRqkutjmXlnKXN +CJ8uE8yUcuWtPSfsqSiEfvBpfcrJ4trQzYgiXfNp4Cy434SsVV5wB2Uki9fTRy2H +Y478bHLT2wgqVqCLartkOKTawy8bx0C/uA1mxen4U6P9dcKI4j1/oPmiykl0r0Hl +QIAGOYZzxbk52/pkt7LlSLvqW4jtyIhM4p8CgSRvIyI0eJHEt0ztoB6LN1zAdThu +bomWaImTxTLJXzl/fea8JJ+6jsP4NBiIrrnT/HBF1MUEiqLfwjAwTraBPtqH8A6a +I+yGPsWPAhTtlYeyTKv2qkTFA4QolegtkmjWt/oxFzwCwnLPrN19CFPUFPOGiA1+ +u7jGNUzp9KuNFQXfiay5ZzP8cqj1bfnQDDbLkXn2TOI/6bsbq4FiuqYSW//XdVqa +DZlnVvfwozPlKzdKR9wMSs7PP8P7SFGU5oIh5a2zUbbNZxC8Gef7MYD6xMi7TEAU +4JECAwEAAaNGMEQwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsGAQUF +BwMDMBoGA1UdEQQTMBGBD2luZm9AYnVpbGQyLm9yZzANBgkqhkiG9w0BAQsFAAOC +AgEATQmuoB+NC/IF2qoNQnurJWrV63lC4Ozi/VLIqCSR6A4S9TCcoLNDAtcdiyf4 +GrM+/USyV3whpISesXn0ij10OEMe2/9NUoqkO0Q/woN9WtUQActeBxThOcz0NYMi +1vg6krlx1fKpQ5g65yC3qka8VUaV9gtaCHFa6mOxZ9q5DaV2NdBAr+FOutRY6d4v +UySkOyqxfZYLs5W2e+9ofEve17eVNFQwuJY29sw406X+18gYc+KiqldPlwKIhJs1 +CBsWhO0m1GP5dR0gRBmF9WQ4fzNyoYF293ix+WC7eMf2OtRTpo/GEAXDqLlRvpiF +jALhFtcZjiIqrvnkQFq36jyVNcUnxbMKUgW4XJVpYv4uVII47eJk4a8XRGj0d+7b +nuFfT4d6gACN3gfOmtd12uT7dNsn5q0fkGhzR4ppDIyTJpGA8UhHETTRPL+HFcb1 +6kXnRPFS7eoF9DoSGtBhdpRUefj8EPJWhfE7xQvMDTYIE/ccBWp173F+xShr2mgF +xDkHH+vXGFzUZXSEAF2NW9U3bf4bRQpdOkYJsvHJmLYjcGNKdkHjJVWdXmoRpbsR +IC8M7ZPp+/oV5JEinCXRsT1NN+7l8rkec9hNk5sbokVCcyYv+GxL8kRFt2jyLqny +RlM2vM3uhgJNYVSlYsgjjg4QfikV6s+QawjSVi6y4ZnHEho= +-----END CERTIFICATE----- +\ diff --git a/tests/rep-auth/expired/signature b/tests/rep-auth/expired/signature new file mode 100644 index 0000000..454653f --- /dev/null +++ b/tests/rep-auth/expired/signature @@ -0,0 +1,13 @@ +: 1 +sha256sum: ad6c46b7c2b994957215025de0f0ce9be192f6973a8b36f5d3f3d1670172af1e +signature: \ +PQrvkr6ONdIIrEaORzsgpXNpNkMVmdjW8Ahgpi+sdwyjsxkgMj/0gHjyF0amPi6ae+zUu4igDeKM +JnWuShDMbxLy+zxy6IpjpchwtPymM3euqQnLWebRJ2b+9RlBVGIRCl25VnFn+mmHW76+yRnOT6nI +fYNCM6eiLihWKLRUCnsj18PZSV7EK68Q3iPAUws4F4A63eKqJe/qSWkRjJrVpi+UFDjYkJi9542D +MELmYFXV592UVoQ3PPK+ZU/Ja+cosHND9mHe2xvLKHFnBKUi5LKvZ+aZdiZXisnisX9PgvGzk+5j +qzzJUse21NLA2J4D+jiH8r2fj4qjh1dLHgocQj3GQeN8r18XvaLtP9+tcLYfphWnyOfk3q12xtn8 +h9yNoVPHVsMiYrB7JXX2TM4qPqepi3f8iQmEfZxWqlI5/cpeQz3DTDZ4wagNbBoYzavUqTjriXCU +eLWVZz89JkYhWYTBPx26XZp56TsN16ZrN6oMtHgVy6YmmbjIea7sZXhNc8a/7FCdxap8PZfJS1cW +LieoZqQF5C0O8+sJnYl88Pp76mtQIgXEsfc5TnvgMosQfXbHzMbD7naD0woWqu5GVKWx6+AdK2uH +KbuSXYrJYfmuS2Ptp/T7ZIkRE2YZPe4+lsMkIiqY1fg2qIdWgpQiH0ZE3Ki3GH4FUWEkurWgxYk= +\ diff --git a/tests/rep-auth/unsigned/foo-1.tar.gz b/tests/rep-auth/unsigned/foo-1.tar.gz new file mode 120000 index 0000000..d771dc4 --- /dev/null +++ b/tests/rep-auth/unsigned/foo-1.tar.gz @@ -0,0 +1 @@ +../../common/foo-1.tar.gz \ No newline at end of file diff --git a/tests/rep-auth/unsigned/repositories b/tests/rep-auth/unsigned/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/rep-auth/unsigned/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/rep-create.test b/tests/rep-create.test new file mode 100644 index 0000000..acc6957 --- /dev/null +++ b/tests/rep-create.test @@ -0,0 +1,184 @@ +# file : tests/rep-create.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test + +# Source repository: +# +# rep-create +# |-- stable +# | |-- foo-1.tar.gz +# | `-- repositories +# `-- testing -> stable (complement) +# |-- foo-2.tar.gz (manifest with unknown name) +# `-- repositories + +: unsigned +: +{ + # Make sure the cloned repository has a valid location, so we can use + # rep-info command to validate the repository info. + # + clone_rep = mkdir 1/ && cp -r $src/stable 1/ + + : without-key + : + { + $clone_rep; + + $* 1/stable/ 2>>/~%EOE% &1/stable/packages; + adding foo 1 + %1 package\(s\) in .+/stable/% + EOE + + $rep_info -p -m 1/stable/ >>EOO + : 1 + sha256sum: 6cac7ffa1f02f90776fc89bcacf38604ba0eddf176f2314c75dc9bf1b10a8b32 + : + name: foo + version: 1 + summary: The "Foo" utility + license: MIT + url: http://www.example.org/foo + email: foo-users@example.org + location: foo-1.tar.gz + sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e + EOO + } + + : with-key + : + { + $clone_rep; + + $* --key $key 1/stable/ 2>>/~%EOE% &1/stable/packages; + adding foo 1 + warning: --key option ignored + info: repository manifest contains no certificate + info: run 'bpkg help rep-create' for more information + %1 package\(s\) in .+/stable/% + EOE + + $rep_info -p -m 1/stable/ >>EOO + : 1 + sha256sum: 6cac7ffa1f02f90776fc89bcacf38604ba0eddf176f2314c75dc9bf1b10a8b32 + : + name: foo + version: 1 + summary: The "Foo" utility + license: MIT + url: http://www.example.org/foo + email: foo-users@example.org + location: foo-1.tar.gz + sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e + EOO + } +} + +: signed +: +: Here we sign the 'stable' repository with the certificate prior to running +: tests. +: +{ + +cp -r $src/stable ./ && cat <<<$cert_manifest >+stable/repositories + + # Make sure the cloned repository has a valid location, so we can use + # rep-info command to validate the repository info. + # + clone_rep = mkdir 1/ && cp -r ../stable 1/ + + : with-key + : + : Note that as we re-create the repositories file on the fly (see above) its + : sha256sum can vary due to CRs mix-in on Windows. That explains why we do + : not match it exactly. + : + { + $clone_rep; + + $* --key $key 1/stable/ 2>>/~%EOE% &1/stable/packages &1/stable/signature; + adding foo 1 + %1 package\(s\) in .+/stable/% + EOE + + $rep_info --cert-fingerprint -p -m 1/stable/ >>~"%EOO%" + $cert_fp + : 1 + %sha256sum: .+% + : + name: foo + version: 1 + summary: The "Foo" utility + license: MIT + url: http://www.example.org/foo + email: foo-users@example.org + location: foo-1.tar.gz + sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e + EOO + } + + : without-key + : + $clone_rep; + $* 1/stable/ 2>>EOE &1/stable/packages != 0 + adding foo 1 + error: --key option required + info: repository manifest contains a certificate + info: run 'bpkg help rep-create' for more information + EOE +} + +: unknown-name +: +: Test that package manifest that contains an unknown name is properly handled. +: +{ + clone_rep = cp -r $src/testing ./ + + : fail + : + $clone_rep; + $* testing/ 2>>/EOE != 0 + foo-2/manifest:8:1: error: unknown name 'color' in package manifest + info: package archive testing/foo-2.tar.gz + EOE + + : ignore + : + $clone_rep; + $* --ignore-unknown testing/ 2>>/~%EOE% &testing/packages + adding foo 2 + %1 package\(s\) in .+/testing/% + EOE +} + +: broken-repo +: +: Here we break the 'stable' repository prior to running a test. +: +{ + clone_rep = cp -r $src/stable ./ + + : no-repositories-file + : + { + $clone_rep &!stable/repositories; + rm stable/repositories; + + $* stable/ 2>/'error: file stable/repositories does not exist' != 0 + } + + : unexpected-file + : + { + $clone_rep; + touch stable/foo; + + $* stable/ 2>>/~%EOE% != 0 + %.+ + error: stable/foo does not appear to be a bpkg package + EOE + } +} diff --git a/tests/rep-create/stable/foo-1.tar.gz b/tests/rep-create/stable/foo-1.tar.gz new file mode 120000 index 0000000..d771dc4 --- /dev/null +++ b/tests/rep-create/stable/foo-1.tar.gz @@ -0,0 +1 @@ +../../common/foo-1.tar.gz \ No newline at end of file diff --git a/tests/rep-create/stable/repositories b/tests/rep-create/stable/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/rep-create/stable/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/rep-create/testing/foo-2.tar.gz b/tests/rep-create/testing/foo-2.tar.gz new file mode 100644 index 0000000..cb39194 Binary files /dev/null and b/tests/rep-create/testing/foo-2.tar.gz differ diff --git a/tests/rep-create/testing/repositories b/tests/rep-create/testing/repositories new file mode 100644 index 0000000..7411f25 --- /dev/null +++ b/tests/rep-create/testing/repositories @@ -0,0 +1,4 @@ +: 1 +location: ../stable +role: complement +: diff --git a/tests/rep-fetch.test b/tests/rep-fetch.test new file mode 100644 index 0000000..e59ebf4 --- /dev/null +++ b/tests/rep-fetch.test @@ -0,0 +1,134 @@ +# file : tests/rep-fetch.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test config.test remote.test + +# Source repository: +# +# rep-fetch +# |-- bar +# | |-- stable -> ../foo/stable (prerequisite) +# | | |-- libbar-1.0.0.tar.gz -> libfoo >= 1.0.0 +# | | `-- repositories +# | |-- testing -> stable (complement), +# | | | ../foo/testing (prerequisite) +# | | |-- libbar-1.1.0.tar.gz -> libfoo >= 1.1.0 +# | | `-- repositories +# | `-- unstable -> testing (complement), +# | | ../foo/testing (prerequisite) +# | |-- libbar-1.1.1.tar.gz -> libfoo >= 1.1.0 +# | `-- repositories +# |-- foo +# | |-- stable +# | | |-- libfoo-1.0.0.tar.gz +# | | `-- repositories +# | `-- testing -> stable (complement) +# | |-- libfoo-1.1.0.tar.gz +# | `-- repositories +# `-- hello +# |-- libhello-1.0.0.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rep_create += 2>- + + # Create the signed 'hello' repository. + # + cp -r $src/hello $out/hello + cat <<<$cert_manifest >+$out/hello/repositories + $rep_create --key $key $out/hello &$out/hello/packages &$out/hello/signature + + # Create 'foo/*' repositories. + # + cp -r $src/foo $out/foo + $rep_create $out/foo/stable &$out/foo/stable/packages + $rep_create $out/foo/testing &$out/foo/testing/packages + + # Create 'bar/*' repositories. + # + cp -r $src/bar $out/bar + $rep_create $out/bar/stable &$out/bar/stable/packages + $rep_create $out/bar/testing &$out/bar/testing/packages + $rep_create $out/bar/unstable &$out/bar/unstable/packages +end + +test.options += --auth all + +rep_add += -d cfg 2>- + +: no-repositories +: +$clone_cfg; +$* 2>>/EOE != 0 + error: configuration cfg/ has no repositories + info: use 'bpkg rep-add' to add a repository + EOE + +: hello +: +{ + $clone_cfg && $rep_add $rep/hello; + + $* --trust $cert_fp 2>>EOE &cfg/.bpkg/certs/***; + fetching build2.org/rep-fetch/hello + 1 package(s) in 1 repository(s) + EOE + + $* 2>>EOE + fetching build2.org/rep-fetch/hello + 1 package(s) in 1 repository(s) + EOE +} + +: bar-unstable +: +{ + $clone_cfg && $rep_add $rep/bar/unstable; + + $* --trust-yes 2>>EOE; + fetching build2.org/rep-fetch/bar/unstable + fetching build2.org/rep-fetch/foo/testing (prerequisite of build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/foo/stable (complements build2.org/rep-fetch/foo/testing) + fetching build2.org/rep-fetch/bar/testing (complements build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/bar/stable (complements build2.org/rep-fetch/bar/testing) + 5 package(s) in 5 repository(s) + EOE + + $* 2>>EOE + fetching build2.org/rep-fetch/bar/unstable + fetching build2.org/rep-fetch/foo/testing (prerequisite of build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/foo/stable (complements build2.org/rep-fetch/foo/testing) + fetching build2.org/rep-fetch/bar/testing (complements build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/bar/stable (complements build2.org/rep-fetch/bar/testing) + 5 package(s) in 5 repository(s) + EOE +} + +: both +: +{ + $clone_cfg && $rep_add $rep/hello && $rep_add $rep/bar/unstable; + + $* --trust-yes 2>>EOE &cfg/.bpkg/certs/***; + fetching build2.org/rep-fetch/bar/unstable + fetching build2.org/rep-fetch/foo/testing (prerequisite of build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/foo/stable (complements build2.org/rep-fetch/foo/testing) + fetching build2.org/rep-fetch/bar/testing (complements build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/bar/stable (complements build2.org/rep-fetch/bar/testing) + fetching build2.org/rep-fetch/hello + 6 package(s) in 6 repository(s) + EOE + + $* 2>>EOE + fetching build2.org/rep-fetch/bar/unstable + fetching build2.org/rep-fetch/foo/testing (prerequisite of build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/foo/stable (complements build2.org/rep-fetch/foo/testing) + fetching build2.org/rep-fetch/bar/testing (complements build2.org/rep-fetch/bar/unstable) + fetching build2.org/rep-fetch/bar/stable (complements build2.org/rep-fetch/bar/testing) + fetching build2.org/rep-fetch/hello + 6 package(s) in 6 repository(s) + EOE +} diff --git a/tests/rep-fetch/bar b/tests/rep-fetch/bar new file mode 120000 index 0000000..7684b42 --- /dev/null +++ b/tests/rep-fetch/bar @@ -0,0 +1 @@ +../common/bar \ No newline at end of file diff --git a/tests/rep-fetch/foo b/tests/rep-fetch/foo new file mode 120000 index 0000000..4ee4799 --- /dev/null +++ b/tests/rep-fetch/foo @@ -0,0 +1 @@ +../common/foo \ No newline at end of file diff --git a/tests/rep-fetch/hello b/tests/rep-fetch/hello new file mode 120000 index 0000000..9312ba9 --- /dev/null +++ b/tests/rep-fetch/hello @@ -0,0 +1 @@ +../common/hello/ \ No newline at end of file diff --git a/tests/rep-info.test b/tests/rep-info.test new file mode 100644 index 0000000..43e455e --- /dev/null +++ b/tests/rep-info.test @@ -0,0 +1,128 @@ +# file : tests/rep-info.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test auth.test remote.test + +# Source repository: +# +# rep-info +# `-- testing -> stable (complement), ../foo/testing (prerequisite) +# |-- foo-1.tar.gz +# `-- repositories + +# Prepare repositories used by tests if running in the local mode. +# ++if ($remote != true) + rc = $rep_create 2>- + + # Create the unsigned 'testing' repository. + # + cp -r $src/testing $out/testing + $rc $out/testing &$out/testing/packages + + # Create the signed 'testing' repository. + # + cp -r $src/testing $out/signed + cat <<<$cert_manifest >+$out/signed/repositories + $rc --key $key $out/signed &$out/signed/packages &$out/signed/signature +end + +test.options = --auth all --trust-yes + +: no-location +: +$* 2>>EOE != 0 +error: repository location argument expected + info: run 'bpkg help rep-info' for more information +EOE + +: default +: +{ + : unsigned + : + $* $rep/testing >>"EOO" + build2.org/rep-info/testing ($rep/testing) + prerequisite build2.org/foo/testing ($rep_root/foo/testing) + complement build2.org/rep-info/stable ($rep/stable) + + foo/1 + EOO + + : signed + : + $* $rep/signed >>"EOO" + build2.org/rep-info/signed ($rep/signed) + CN=build2.org/O=Code Synthesis/info@build2.org + $cert_fp + prerequisite build2.org/foo/testing ($rep_root/foo/testing) + complement build2.org/rep-info/stable ($rep/stable) + + foo/1 + EOO +} + +: name +: +$* --name $rep/testing >"build2.org/rep-info/testing ($rep/testing)" + +: packages +: +{ + : list + : + $* --packages $rep/testing >>EOO + + foo/1 + EOO + + : manifest + : + $* --packages --manifest $rep/testing >>EOO + : 1 + sha256sum: 7cdc5965cf41742a7feb1c4b73f1438f35e6a6ed7e4e6b30d9fba36c26baca04 + : + name: foo + version: 1 + summary: The "Foo" utility + license: MIT + url: http://www.example.org/foo + email: foo-users@example.org + location: foo-1.tar.gz + sha256sum: fee330a362a4f87ff42a954aa305b6446d541b7b60000ebcd2fbf68f2b1ae58e + EOO +} + +: repositories +: +{ + : list + : + $* --repositories $rep/testing >>"EOO" + prerequisite build2.org/foo/testing ($rep_root/foo/testing) + complement build2.org/rep-info/stable ($rep/stable) + EOO + + : manifest + : + $* --repositories --manifest $rep/testing >>EOO + : 1 + location: ../../foo/testing + : + location: ../stable + role: complement + : + EOO +} + +: cert +: +{ + test.arguments += $rep/signed + + $* --cert-fingerprint >"$cert_fp" : fingerprint + $* --cert-name >'name:build2.org' : name + $* --cert-organization >'Code Synthesis' : organization + $* --cert-email >'info@build2.org' : email +} diff --git a/tests/rep-info/testing/foo-1.tar.gz b/tests/rep-info/testing/foo-1.tar.gz new file mode 120000 index 0000000..d771dc4 --- /dev/null +++ b/tests/rep-info/testing/foo-1.tar.gz @@ -0,0 +1 @@ +../../common/foo-1.tar.gz \ No newline at end of file diff --git a/tests/rep-info/testing/repositories b/tests/rep-info/testing/repositories new file mode 100644 index 0000000..3cc2531 --- /dev/null +++ b/tests/rep-info/testing/repositories @@ -0,0 +1,6 @@ +: 1 +location: ../../foo/testing +: +location: ../stable +role: complement +: diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index 6858ea6..0000000 --- a/tests/test.sh +++ /dev/null @@ -1,2003 +0,0 @@ -#! /usr/bin/env bash - -# Usage: test.sh [test-options] [bpkg-common-options] -# -# Test options are: -# -# -v -# Run verbose. By default, this script runs bpkg quiet and suppresses -# error messages in the fail tests. Note that when this options is -# specified, bpkg is called with default verbosity level. If you want -# more bpkg diagnostics, add the --verbose N option. -# -# --remote -# Test using the remote repositories. Normally, you would first run the -# local test in order to create the repositories, then publish them (see -# pkg/publish.sh), and finally run the remote test. -# -# -c -# Use the compiler specified to configure cxx module. -# -# --valgrind -# Run under valgrind (takes forever). -# -# Some common bpkg use-cases worth testing: -# -# --fetch wget -# --fetch curl -# --fetch fetch --fetch-option --no-verify-peer -# -# --tar bsdtar -# -# --sha256 shasum -# --sha256 sha256-freebsd -# - -trap 'exit 1' ERR - -tmp_file=`mktemp` - -# Remove temporary file on exit. Cover the case when exit due to an error. -# -trap 'rm -f $tmp_file' EXIT - -function error () -{ - echo "$*" 1>&2 - exit 1 -} - -bpkg="../bpkg/bpkg" -cfg=/tmp/conf - -if [ "${MSYSTEM:0:5}" = "MINGW" -o "${MSYSTEM:0:4}" = "MSYS" ]; then - msys=y -fi - -verbose=n -remote=n -options= -cxx_options= - -while [ $# -gt 0 ]; do - case $1 in - -v) - verbose=y - shift - ;; - --remote) - remote=y - shift - ;; - --valgrind) - bpkg="valgrind -q $bpkg" - shift - ;; - -c) - shift - cxx_options="config.cxx=$1" - shift - ;; - *) - # If this is the --verbose bpkg option, switch to the verbose - # mode as well. - # - if [ "$1" == "--verbose" ]; then - verbose=y - fi - - options="$options $1" - shift - ;; - esac -done - -if [ "$verbose" != "y" ]; then - options="$options -q" -fi - -bpkg="$bpkg $options" - -# Repository location and name prefixes. Note that the local path is carefully -# crafted so that we end up with the same repository names in both cases. This -# is necessary for the authentication tests to work in both cases. -# -if [ "$remote" = "y" ]; then - rep=https://build2.org/bpkg/1 - repn=build2.org/ -else - rep=pkg/1/build2.org - repn=build2.org/ -fi - -# -# -function test () -{ - local cmd=$1; shift - local ops= - - if [ "$cmd" != "rep-create" -a \ - "$cmd" != "rep-info" -a \ - "$cmd" != "pkg-verify" ]; then - ops="-d $cfg" - fi - - if [ "$cmd" = "rep-fetch" -o \ - "$cmd" = "rep-info" ]; then - ops="$ops --auth all" - fi - - if [ -t 0 ]; then - $bpkg $cmd $ops $* - else - $bpkg $cmd $ops $* >$tmp_file - diff --strip-trailing-cr -u - $tmp_file - fi - - if [ $? -ne 0 ]; then - error "failed: $bpkg $cmd $ops $*" - fi -} - -function fail () -{ - local cmd=$1; shift - local ops= - - if [ "$cmd" != "rep-create" -a \ - "$cmd" != "rep-info" -a \ - "$cmd" != "pkg-verify" ]; then - ops="-d $cfg" - fi - - if [ "$cmd" = "rep-fetch" -o \ - "$cmd" = "rep-info" ]; then - ops="$ops --auth all" - fi - - if [ "$verbose" = "y" ]; then - $bpkg $cmd $ops $* - else - $bpkg $cmd $ops $* 2>/dev/null - fi - - if [ $? -eq 0 ]; then - error "succeeded: $bpkg $cmd $ops $*" - fi - - return 0 -} - -# Verify package status. -# -function stat () -{ - local s=`$bpkg pkg-status -d $cfg $1` - - if [ "$s" != "$2" ]; then - error "status $1: '$s', expected: '$2'" - fi -} - -# Verify path is gone (no longer exists) -# -function gone () -{ - if [ -e "$1" ]; then - error "path $1 still exists" - fi -} - -# Repository certificate fingerprint. -# -function rep_cert_fp () -{ - cat $1/repositories | \ - sed -n '/^-----BEGIN CERTIFICATE-----$/,/^-----END CERTIFICATE-----$/p' | \ - openssl x509 -sha256 -noout -fingerprint | \ - sed -n 's/^SHA256 Fingerprint=\(.*\)$/\1/p' -} - -# Edit file with sed. -# -function edit () -{ - local path=$1; shift - sed "$@" $path > $path.bak - mv $path.bak $path -} - -# Repository absolute location from a relative path. -# -function location () -{ - if [ "$remote" = "y" ]; then - echo "$rep/$1" - elif [ "$msys" = "y" ]; then - # Convert Windows path like c:/abc/xyz to the c:\abc\xyz canonical form. - # - echo "`pwd -W`/$rep/$1" | sed 's%/%\\%g' - else - echo "`pwd`/$rep/$1" - fi -} - -## -## Low-level commands. -## - -## -## pkg-verify -## -fail pkg-verify # archive expected -fail pkg-verify ./no-such-file # archive does not exist -fail pkg-verify pkg/1/build2.org/common/not-a-package.tar.gz -fail pkg-verify --silent pkg/1/build2.org/common/not-a-package.tar.gz -test pkg-verify pkg/1/build2.org/common/hello/libhello-1.0.0.tar.gz - - -## -## rep-create -## -fail rep-create # no 'repositories' file -fail rep-create pkg/1/build2.org/satisfy # unexpected files - -test rep-create pkg/1/build2.org/common/hello --key key.pem - -test rep-create pkg/1/build2.org/common/foo/stable -test rep-create pkg/1/build2.org/common/foo/testing - -test rep-create pkg/1/build2.org/common/bar/stable -test rep-create pkg/1/build2.org/common/bar/testing -test rep-create pkg/1/build2.org/common/bar/unstable - - -## -## rep-info -## -fail rep-info # repository location expected - -test rep-info --trust-yes $rep/common/foo/testing <= 1.1.0 -location: libbar-1.1.1.tar.gz -sha256sum: d09700602ff78ae405b6d4850e34660e939d27676e015a23b549884497c8bb45 -EOF - -hello_fp=`rep_cert_fp pkg/1/build2.org/common/hello` - -test rep-info -m -p --trust $hello_fp $rep/common/hello <= 0.4.0 -location: libhello-1.0.0.tar.gz -sha256sum: d18d1472980399dd1fdbc776cb3eb3f7b2f62447210c8cfbcf1a8dd52a468395 -EOF - -## -## cfg-create -## -test cfg-create --wipe cxx $cxx_options config.install.root=/tmp/install -stat libfoo unknown - -test cfg-create --wipe config.install.root=/tmp/install cxx $cxx_options -stat libfoo unknown - - -## -## rep-add -## -test cfg-create --wipe - -fail rep-add # repository location expected -fail rep-add stable # invalid location -fail rep-add http:// # invalid location - -# relative path -# -test rep-add ./1/bar/stable -fail rep-add ./1/../1/bar/stable # duplicate - -# absolute path -# -test rep-add /tmp/1/foo/stable -fail rep-add /tmp/1/../1/foo/stable # duplicate - -# remote URL -# -test rep-add http://pkg.example.org/1/testing -fail rep-add https://www.example.org/1/testing # duplicate - - -## -## rep-fetch -## -test cfg-create --wipe - -fail rep-fetch # no repositories - -# hello repository -# -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp -test rep-fetch - -# bar/unstable repository -# -test cfg-create --wipe -test rep-add $rep/common/bar/unstable -test rep-fetch --trust-yes -test rep-fetch - -# both -# -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-add $rep/common/bar/unstable -test rep-fetch --trust-yes -test rep-fetch - - -## -## pkg-fetch -## -test rep-create pkg/1/build2.org/fetch/t1 -test cfg-create --wipe - -fail pkg-fetch -e # archive expected -fail pkg-fetch -e ./no-such-file # archive does not exist - -fail pkg-fetch # package name expected -fail pkg-fetch libfoo # package version expected -fail pkg-fetch libfoo/1/2/3 # invalid package version - -fail pkg-fetch libfoo/1.0.0 # no repositories -test rep-add $rep/fetch/t1 -fail pkg-fetch libfoo/1.0.0 # no packages -test rep-fetch --trust-yes -fail pkg-fetch libfoo/2+1.0.0 # not available -test cfg-create --wipe -test rep-add $rep/fetch/t1 -test rep-fetch --trust-yes -test pkg-fetch libfoo/1.0.0 -stat libfoo/1.0.0 "fetched; available" -fail pkg-fetch libfoo/1.0.0 -fail pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -test pkg-purge libfoo -test pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -stat libfoo/1.0.0 "fetched; available" -test pkg-unpack libfoo -test pkg-fetch -r libfoo/1.1.0 -stat libfoo/1.1.0 "fetched; available" -test pkg-unpack libfoo -test pkg-fetch -r -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -stat libfoo/1.0.0 "fetched; available" -test pkg-fetch -r libfoo/1.1.0 -stat libfoo/1.1.0 "fetched; available" -test pkg-fetch -r -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -stat libfoo/1.0.0 "fetched; available" -test pkg-purge libfoo - -# hello -# -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp -test pkg-fetch libhello/1.0.0 -test pkg-purge libhello - - -## -## pkg-unpack -## -test cfg-create --wipe -fail pkg-unpack -r # replace only with existing -fail pkg-unpack -e # package directory expected -fail pkg-unpack # package name expected - -test rep-add $rep/fetch/t1 -test rep-fetch --trust-yes - -# existing -# -fail pkg-unpack -e ./no-such-dir # package directory does not exist -fail pkg-unpack -e ./pkg # not a package directory -test pkg-fetch libfoo/1.0.0 -fail pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 # already exists -test pkg-purge libfoo -test pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -stat libfoo/1.1.0 "unpacked; available" -test pkg-purge libfoo - -# existing & replace -# -test pkg-fetch libfoo/1.0.0 -fail pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -test pkg-unpack -r -e pkg/1/build2.org/fetch/libfoo-1.1.0 -stat libfoo/1.1.0 "unpacked; available" -test pkg-purge libfoo -test pkg-fetch libfoo/1.0.0 -test pkg-unpack libfoo -fail pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -test pkg-unpack -r -e pkg/1/build2.org/fetch/libfoo-1.1.0 -stat libfoo/1.1.0 "unpacked; available" -test pkg-purge libfoo - -# package name -# -fail pkg-unpack libfoo # no such package in configuration -test pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -fail pkg-unpack libfoo # wrong package state -test pkg-purge libfoo -test pkg-fetch libfoo/1.0.0 -stat libfoo/1.0.0 "fetched; available" -test pkg-unpack libfoo -stat libfoo/1.0.0 "unpacked; available" -test pkg-purge libfoo - -# hello -# -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp -test pkg-fetch libhello/1.0.0 -test pkg-unpack libhello -test pkg-purge libhello - - -## -## pkg-purge -## -test cfg-create --wipe - -fail pkg-purge # missing package name -fail pkg-purge libfoo # no such package - -# purge fetched -# -test pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -test pkg-purge libfoo -stat libfoo unknown - -# --keep -# -test pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -test pkg-purge -k libfoo -stat libfoo "fetched 1.0.0" -test pkg-purge libfoo - -# archive and --purge -# -cp pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz $cfg/ -test pkg-fetch -e -p $cfg/libfoo-1.0.0.tar.gz -test pkg-purge libfoo -stat libfoo unknown -gone $cfg/libfoo-1.0.0.tar.gz - -# no archive but --keep -# -test pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -fail pkg-purge --keep libfoo -stat libfoo "unpacked 1.1.0" -test pkg-purge libfoo - -# purge unpacked directory -# -test pkg-unpack -e pkg/1/build2.org/fetch/libfoo-1.1.0 -test pkg-purge libfoo -stat libfoo unknown - -# purge unpacked archive -# -test pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -test pkg-unpack libfoo -test pkg-purge libfoo -stat libfoo unknown -gone $cfg/libfoo-1.0.0 - -# purge unpacked archive but --keep -# -test pkg-fetch -e pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz -test pkg-unpack libfoo -test pkg-purge --keep libfoo -stat libfoo "fetched 1.0.0" -gone $cfg/libfoo-1.0.0 -test pkg-purge libfoo -stat libfoo unknown - -# directory and --purge -# -cp -r pkg/1/build2.org/fetch/libfoo-1.1.0 $cfg/ -test pkg-unpack -e -p $cfg/libfoo-1.1.0 -test pkg-purge libfoo -stat libfoo unknown -gone $cfg/libfoo-1.1.0 - -# archive and --purge -# -cp pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz $cfg/ -test pkg-fetch -e -p $cfg/libfoo-1.0.0.tar.gz -test pkg-unpack libfoo -test pkg-purge libfoo -stat libfoo unknown -gone $cfg/libfoo-1.0.0 -gone $cfg/libfoo-1.0.0.tar.gz - -# broken -# -cp pkg/1/build2.org/fetch/libfoo-1.0.0.tar.gz $cfg/ -test pkg-fetch -e -p $cfg/libfoo-1.0.0.tar.gz -test pkg-unpack libfoo -chmod 000 $cfg/libfoo-1.0.0 -fail pkg-purge libfoo -stat libfoo/1.0.0 broken -fail pkg-purge libfoo # need --force -fail pkg-purge -f -k libfoo # can't keep broken -fail pkg-purge -f libfoo # out directory still exists -chmod 755 $cfg/libfoo-1.0.0 -rm -r $cfg/libfoo-1.0.0 -fail pkg-purge -f libfoo # archive still exists -rm $cfg/libfoo-1.0.0.tar.gz -test pkg-purge -f libfoo -stat libfoo unknown - -## -## pkg-configure/pkg-disfigure -## -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp - -fail pkg-configure # package name expected -fail pkg-configure config.dist.root=/tmp # ditto -fail pkg-configure libhello libhello # unexpected argument -fail pkg-configure libhello1 # no such package - -fail pkg-disfigure # package name expected -fail pkg-disfigure libhello1 # no such package - -test pkg-fetch libhello/1.0.0 - -fail pkg-configure libhello $cxx_options # wrong package state -fail pkg-disfigure libhello # wrong package state - -test pkg-purge libhello - -# src == out -# -test pkg-fetch libhello/1.0.0 -test pkg-unpack libhello -test pkg-configure libhello $cxx_options -stat libhello "configured 1.0.0; available sys:?" -test pkg-disfigure libhello -stat libhello "unpacked 1.0.0; available sys:?" -test pkg-purge libhello -stat libhello/1.0.0 "available" - -# src != out -# -test cfg-create --wipe -test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 -test pkg-configure libhello $cxx_options -stat libhello "configured 1.0.0" -test pkg-disfigure libhello -stat libhello "unpacked 1.0.0" -test pkg-purge libhello -stat libhello unknown -gone $cfg/libhello-1.0.0 - -# out still exists after disfigure -# -test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 -test pkg-configure libhello $cxx_options -touch $cfg/libhello-1.0.0/stray -fail pkg-disfigure libhello -stat libhello/1.0.0 broken -rm -r $cfg/libhello-1.0.0 -test pkg-purge -f libhello -stat libhello unknown - -# disfigure failed -# -test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 -test pkg-configure libhello $cxx_options -chmod 555 $cfg/libhello-1.0.0 -fail pkg-disfigure libhello -stat libhello/1.0.0 broken -chmod 755 $cfg/libhello-1.0.0 -rm -r $cfg/libhello-1.0.0 -test pkg-purge -f libhello -stat libhello unknown - -# While it's forbidden to delete a directory with write permissions being -# revoked with the 'chmod 555' command in MSYS, it's still allowed to create -# subdirectories and files inside such a directory. This is why the following -# 'fail pkg-configure libhello' test cases undesirably succeed in MSYS. -# -if [ "$msys" != "y" ]; then - # configure failed but disfigure succeeds - # - test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 - mkdir -p $cfg/libhello-1.0.0/build - chmod 555 $cfg/libhello-1.0.0/build - fail pkg-configure libhello $cxx_options - stat libhello "unpacked 1.0.0" - test pkg-purge libhello - stat libhello unknown - - # configure and disfigure both failed - # - test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 - mkdir -p $cfg/libhello-1.0.0/build - # Trip both con/dis. - # - chmod 555 $cfg/libhello-1.0.0 $cfg/libhello-1.0.0/build - fail pkg-configure libhello $cxx_options - stat libhello/1.0.0 broken - chmod 755 $cfg/libhello-1.0.0 $cfg/libhello-1.0.0/build - rm -r $cfg/libhello-1.0.0 - test pkg-purge -f libhello - stat libhello unknown -fi - -# dependency management -# -test rep-create pkg/1/build2.org/depend/stable -test cfg-create --wipe -test rep-add $rep/depend/stable -test rep-fetch --trust-yes - -test pkg-fetch libbar/1.0.0 -test pkg-unpack libbar -fail pkg-configure libbar # no libfoo -stat libbar/1.0.0 "unpacked; available" -test pkg-fetch libfoo/1.0.0 -test pkg-unpack libfoo -fail pkg-configure libbar # libfoo not configured -test pkg-configure libfoo -test pkg-configure libbar -fail pkg-disfigure libfoo # libbar still depends on libfoo -test pkg-disfigure libbar -test pkg-disfigure libfoo -test pkg-purge libbar -test pkg-purge libfoo - -test pkg-fetch libfoo/1.0.0 -test pkg-unpack libfoo -test pkg-configure libfoo -test pkg-fetch libbar/1.1.0 -test pkg-unpack libbar -fail pkg-configure libbar # libfoo >= 1.1.0 -test pkg-disfigure libfoo -test pkg-purge libfoo -test pkg-fetch libfoo/1.1.0 -test pkg-unpack libfoo -test pkg-configure libfoo -test pkg-configure libbar -test pkg-disfigure libbar -test pkg-disfigure libfoo -test pkg-purge libfoo -test pkg-purge libbar - -test pkg-fetch libfoo/1.1.0 -test pkg-unpack libfoo -test pkg-configure libfoo -test pkg-fetch libbar/1.2.0 -test pkg-unpack libbar -fail pkg-configure libbar # libfoo >= 1.2.0 -test pkg-disfigure libfoo -test pkg-purge libfoo -test pkg-fetch libfoo/1.2.0 -test pkg-unpack libfoo -test pkg-configure libfoo -test pkg-configure libbar -fail pkg-disfigure libfoo # "package libbar on libfoo >= 1.2.0" -test pkg-disfigure libbar -test pkg-disfigure libfoo -test pkg-purge libfoo -test pkg-purge libbar - -test pkg-fetch libfoo/1.1.0 -test pkg-unpack libfoo -test pkg-configure libfoo -test pkg-fetch libbar/1.3.0 -test pkg-unpack libbar -fail pkg-configure libbar # incompatible constraints -test pkg-disfigure libfoo -test pkg-purge libfoo -test pkg-purge libbar - - -## -## pkg-status (also tested in pkg-{fetch,unpack,configure,disfigure,purge}) -## -test rep-create pkg/1/build2.org/status/stable -test rep-create pkg/1/build2.org/status/extra -test rep-create pkg/1/build2.org/status/testing -test rep-create pkg/1/build2.org/status/unstable - -# basics -# -test cfg-create --wipe -stat libfoo/1.0.0 "unknown" -stat libfoo "unknown" -test rep-add $rep/status/stable -test rep-fetch --trust-yes -stat libfoo/1.0.0 "available" -stat libfoo "available 1.0.0 sys:?" -test pkg-fetch libfoo/1.0.0 -stat libfoo/1.0.0 "fetched; available" -stat libfoo "fetched 1.0.0; available sys:?" - -# multiple versions/revisions -# -test cfg-create --wipe -test rep-add $rep/status/extra -test rep-fetch --trust-yes -stat libbar "available 1.1.0+1 sys:?" -test rep-add $rep/status/stable -test rep-fetch --trust-yes -stat libbar "available 1.1.0+1 1.0.0 sys:?" - -test cfg-create --wipe -test rep-add $rep/status/testing -test rep-fetch --trust-yes -stat libbar "available 1.1.0 1.0.0+1 1.0.0 sys:?" - -test cfg-create --wipe -test rep-add $rep/status/unstable -test rep-fetch --trust-yes -stat libbar "available 2.0.0 1.1.0 1.0.0+1 1.0.0 sys:?" -test pkg-fetch libbar/1.0.0+1 -stat libbar "fetched 1.0.0+1; available 2.0.0 1.1.0 sys:?" -test pkg-purge libbar -test pkg-fetch libbar/2.0.0 -stat libbar "fetched 2.0.0; available sys:?" - - -## -## pkg-update -## -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp - -fail pkg-update # package name expected -fail pkg-update libhello # no such package -test pkg-fetch libhello/1.0.0 -fail pkg-update libhello # wrong package state -test pkg-purge libhello - -# src == out -# -test pkg-fetch libhello/1.0.0 -test pkg-unpack libhello -test pkg-configure libhello $cxx_options -test pkg-update libhello -test pkg-update libhello -test pkg-disfigure libhello -test pkg-purge libhello - -# src != out -# -test cfg-create --wipe -test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 -test pkg-configure libhello $cxx_options -test pkg-update libhello -test pkg-update libhello -test pkg-disfigure libhello -test pkg-purge libhello - - -## -## pkg-clean -## -test cfg-create --wipe -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp - -fail pkg-clean # package name expected -fail pkg-clean libhello # no such package -test pkg-fetch libhello/1.0.0 -fail pkg-clean libhello # wrong package state -test pkg-purge libhello - -# src == out -# -test pkg-fetch libhello/1.0.0 -test pkg-unpack libhello -test pkg-configure libhello $cxx_options -test pkg-update libhello -test pkg-clean libhello -test pkg-clean libhello -test pkg-disfigure libhello -test pkg-purge libhello - -# src != out -# -test cfg-create --wipe -test pkg-unpack -e pkg/1/build2.org/common/libhello-1.0.0 -test pkg-configure libhello $cxx_options -test pkg-update libhello -test pkg-clean libhello -test pkg-clean libhello -test pkg-disfigure libhello -test pkg-purge libhello - - -## -## Low-level command scenarios. -## - - -# build and clean package -# -test cfg-create --wipe cxx $cxx_options -test rep-add $rep/common/hello -test rep-fetch --trust $hello_fp -test pkg-fetch libhello/1.0.0 -test pkg-unpack libhello -test pkg-configure libhello $cxx_options -test pkg-update libhello -test pkg-clean libhello -test pkg-disfigure libhello -test pkg-purge libhello - -## -## pkg-build -## - -# 1 (libfoo) -# -test rep-create pkg/1/build2.org/satisfy/t1 -test cfg-create --wipe - -fail pkg-build -p # package name expected -fail pkg-build -p libfoo # unknown package -fail pkg-build -p libfoo/1.0.0 # unknown package -test pkg-build -p pkg/1/build2.org/satisfy/libfoo-1.1.0.tar.gz <= 1.1.0) -# -test rep-create pkg/1/build2.org/satisfy/t4a -test rep-create pkg/1/build2.org/satisfy/t4b -test rep-create pkg/1/build2.org/satisfy/t4c -test rep-create pkg/1/build2.org/satisfy/t4d - -test cfg-create --wipe -test rep-add $rep/satisfy/t4c -test rep-fetch --trust-yes - -test pkg-build -p libbaz <> pkg/1/build2.org/auth/signature-mismatch/signature << EOF -signature: \\ -XBjnmXXVHY0RqMI0gL/P4t/vuWwK9JJkLl4Qf2gMxq5k2WQ2CIE56DfG0RaGklgKcI3UxsQZvMQI -5PNtAHJDjteQ+BqY0io8A43KPX+2LKMU+I825sKmPRjCLYleGM3mNndDkWfYtAzYk5AmR2piqRz0 -D7CLq9GIoQQZO4Fw44muaQDMCRcXy8Txx2jDnretQjx/C0ZQw4M/cd6/cKEKUmLITDkBig9oVlSh -tpxHqWz5NTbO3vm8ILc03AwiOJHwZweLb6ocJ6a467IJa+F/xUm9B09k8wFWMs+jHXXzHDE0syv7 -lqWL7SvHSjVFrGVFKS6nx7lCj2b8XFiGlwWIwjY4m/VK/5QmbL/lC4f+ww5XT5NG5iYh/eMaCxCJ -zTg5iZsWNLhrx9uKNrL5xC4z0OONRVOwzu7gsqr0GLWewPyhH0AqJLgOSkw9N7FJwbv2IKNZ88YA -u2YMXNkXytcQvENLVQDX5oxvUMEurUJFOCuYB/SEnpcwkV5h9RtXzIFVy4OCTU2MhQHDEldI8s7w -Hga/ct4WupgE228gGdgwJLCbHx6AWBlS9iL10AdS8JkQ9LaZwTMHHz44f8y00X4MiT06gpgDeoQD -rUyP0KNG65tdWnVTMqg6Q/YXhtRZLHoD6+QbiYLlruR1phu4y4fDt7AKxoXfeme/a86A37UogZY= -\\ -EOF - -# rep-fetch -# -signed_fp=`rep_cert_fp pkg/1/build2.org/auth/signed` -test cfg-create --wipe -test rep-add $rep/auth/signed -test rep-fetch --trust $signed_fp -test rep-fetch - -test cfg-create --wipe -test rep-add $rep/auth/signed -test rep-fetch --trust-no --trust $signed_fp -test rep-fetch -test rep-fetch --trust-no # certificate is already trusted - -test cfg-create --wipe -test rep-add $rep/auth/signed -test rep-fetch --trust-yes -test rep-fetch - -test cfg-create --wipe -test rep-add $rep/auth/signed -fail rep-fetch --trust-no - -test cfg-create --wipe -test rep-add $rep/auth/signed -fail rep-fetch --trust-yes --trust-no # inconsistent options - -test cfg-create --wipe -test rep-add $rep/auth/unsigned1 -test rep-fetch --trust-yes -test rep-fetch -test rep-add $rep/auth/unsigned2 -test rep-fetch -test rep-fetch --trust-no # certificates are already trusted - -test cfg-create --wipe -test rep-add $rep/auth/unsigned1 -fail rep-fetch --trust-no - -test cfg-create --wipe -test rep-add $rep/auth/name-mismatch -fail rep-fetch --trust-yes # certificate name mismatch - -test cfg-create --wipe -test rep-add $rep/auth/expired -fail rep-fetch --trust-yes # certificate expired - -test cfg-create --wipe -test rep-add $rep/auth/sha256sum-mismatch -fail rep-fetch --trust-yes # packages file checksum mismatch - -test cfg-create --wipe -test rep-add $rep/auth/signature-mismatch -fail rep-fetch --trust-yes # packages file signature:mismatch - -# rep-info -# -test cfg-create --wipe -test rep-info --trust-no --trust $signed_fp -d $cfg $rep/auth/signed <libbar>=2), libbar/2 -test rep-create pkg/1/build2.org/system/t2 # foo/2 (->libbar>=2), libbar/0+1 -test rep-create pkg/1/build2.org/system/t3 # ->t2; foo/2 (->libbar>=2) - -function build () -{ - test build -p $* - test build -y $* -} - -# Fetch system/t1 repository: foo/2 (->libbar/2), libbar/2 -# -test cfg-create --wipe -test rep-add $rep/system/t1 -test rep-fetch --trust-yes - -# Fail to build different combinations of package duplicates on the command -# line. -# -fail build sys:libbar ?sys:libbar -fail build ?sys:libbar sys:libbar -fail build ?sys:libbar libbar -fail build libbar ?sys:libbar -fail build sys:libbar libbar -fail build libbar sys:libbar - -# Build sys:libbar/*. -# -build sys:libbar <<< 'configure sys:libbar/*' -stat libbar \ - 'configured,system * hold_package hold_version; available 2 1 sys:?' -stat libbaz 'available 2 sys:?' - -# Build foo with preconfigured sys:libbar/*. -# -build foo <<< "build foo/2" -stat foo 'configured 2 hold_package; available sys:?' -stat libbar \ - 'configured,system * hold_package hold_version; available 2 1 sys:?' -stat libbaz 'available 2 sys:?' - -# Reconfigure sys:libbar/* to 2. -# -build sys:libbar/2 <libbar>=2), libbar/0+1 -# -test cfg-create --wipe -test rep-add $rep/system/t2 -test rep-fetch --trust-yes - -# Fail to build foo having no system package configured. -# -fail build foo -fail build foo libbar -stat foo 'available 2 sys:?' -stat libbar 'available sys:?' - -# Build foo configuring sys:libbar. -# -build foo sys:libbar <libbar>=2), libbar/0+1 -# -test cfg-create --wipe -test rep-add $rep/system/t3 # ->t2; foo/2 (->libbar>=2) -test rep-fetch --trust-yes - -# After test number of faulty builds, then build foo ?sys:libbar/2. Afterwards -# fail attempts to reconfigure libbar. -# -fail build foo -fail build sys:libbar/1 -fail build foo sys:libbar/1 -fail build foo ?sys:libbar/1 -stat foo 'available 2 sys:?' -stat libbar 'unknown' - -build foo ?sys:libbar/2 <