From 53c2aa8e382dd50d09b385285bc3fa0b645ace0a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 19 Aug 2016 17:37:29 +0300 Subject: Support system packages --- tests/pkg/1/build2.org/satisfy/libfoo-0.0.0.tar.gz | Bin 348 -> 0 bytes tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz | Bin 0 -> 352 bytes tests/pkg/1/build2.org/system/foo-2.tar.gz | Bin 0 -> 356 bytes tests/pkg/1/build2.org/system/libbar-0+1.tar.gz | Bin 0 -> 239 bytes tests/pkg/1/build2.org/system/libbar-1.tar.gz | Bin 0 -> 352 bytes tests/pkg/1/build2.org/system/libbar-2.tar.gz | Bin 0 -> 353 bytes tests/pkg/1/build2.org/system/libbaz-2.tar.gz | Bin 0 -> 338 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/test.sh | 687 +++++++++++++++------ 16 files changed, 522 insertions(+), 173 deletions(-) delete mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-0.0.0.tar.gz create mode 100644 tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz create mode 100644 tests/pkg/1/build2.org/system/foo-2.tar.gz create mode 100644 tests/pkg/1/build2.org/system/libbar-0+1.tar.gz create mode 100644 tests/pkg/1/build2.org/system/libbar-1.tar.gz create mode 100644 tests/pkg/1/build2.org/system/libbar-2.tar.gz create mode 100644 tests/pkg/1/build2.org/system/libbaz-2.tar.gz create mode 120000 tests/pkg/1/build2.org/system/t1/foo-2.tar.gz create mode 120000 tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz create mode 120000 tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz create mode 120000 tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz create mode 100644 tests/pkg/1/build2.org/system/t1/repositories create mode 120000 tests/pkg/1/build2.org/system/t2/foo-2.tar.gz create mode 120000 tests/pkg/1/build2.org/system/t2/libbar-0+1.tar.gz create mode 100644 tests/pkg/1/build2.org/system/t2/repositories (limited to 'tests') diff --git a/tests/pkg/1/build2.org/satisfy/libfoo-0.0.0.tar.gz b/tests/pkg/1/build2.org/satisfy/libfoo-0.0.0.tar.gz deleted file mode 100644 index befd2a4..0000000 Binary files a/tests/pkg/1/build2.org/satisfy/libfoo-0.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 new file mode 100644 index 0000000..2ab5094 Binary files /dev/null and b/tests/pkg/1/build2.org/satisfy/libfoo-0.0.1.tar.gz differ diff --git a/tests/pkg/1/build2.org/system/foo-2.tar.gz b/tests/pkg/1/build2.org/system/foo-2.tar.gz new file mode 100644 index 0000000..7fef159 Binary files /dev/null and b/tests/pkg/1/build2.org/system/foo-2.tar.gz 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 new file mode 100644 index 0000000..9f90936 Binary files /dev/null and b/tests/pkg/1/build2.org/system/libbar-0+1.tar.gz 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 new file mode 100644 index 0000000..4b52278 Binary files /dev/null and b/tests/pkg/1/build2.org/system/libbar-1.tar.gz 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 new file mode 100644 index 0000000..28ad509 Binary files /dev/null and b/tests/pkg/1/build2.org/system/libbar-2.tar.gz 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 new file mode 100644 index 0000000..3e9c3e6 Binary files /dev/null and b/tests/pkg/1/build2.org/system/libbaz-2.tar.gz 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 new file mode 120000 index 0000000..39d2e10 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t1/foo-2.tar.gz @@ -0,0 +1 @@ +../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 new file mode 120000 index 0000000..971bed1 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t1/libbar-1.tar.gz @@ -0,0 +1 @@ +../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 new file mode 120000 index 0000000..2c8027b --- /dev/null +++ b/tests/pkg/1/build2.org/system/t1/libbar-2.tar.gz @@ -0,0 +1 @@ +../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 new file mode 120000 index 0000000..111a2e7 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t1/libbaz-2.tar.gz @@ -0,0 +1 @@ +../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 new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t1/repositories @@ -0,0 +1 @@ +: 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 new file mode 120000 index 0000000..39d2e10 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t2/foo-2.tar.gz @@ -0,0 +1 @@ +../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 new file mode 120000 index 0000000..82bdcba --- /dev/null +++ b/tests/pkg/1/build2.org/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/1/build2.org/system/t2/repositories b/tests/pkg/1/build2.org/system/t2/repositories new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/pkg/1/build2.org/system/t2/repositories @@ -0,0 +1 @@ +: 1 diff --git a/tests/test.sh b/tests/test.sh index e6d3033..154177f 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -176,7 +176,7 @@ function stat () local s=`$bpkg pkg-status -d $cfg $1` if [ "$s" != "$2" ]; then - error "status $1: '"$s"', expected: '"$2"'" + error "status $1: '$s', expected: '$2'" fi } @@ -189,8 +189,6 @@ function gone () fi } -#if false; then - # Repository certificate fingerprint. # function rep_cert_fp () @@ -229,7 +227,6 @@ function location () ## Low-level commands. ## - ## ## pkg-verify ## @@ -264,7 +261,7 @@ fail rep-info # repository location expected test rep-info --trust-yes $rep/common/foo/testing <= 1.1.0) @@ -1136,15 +1126,15 @@ test rep-add $rep/satisfy/t4c test rep-fetch --trust-yes test pkg-build -p libbaz <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 <