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/test.sh | 687 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 514 insertions(+), 173 deletions(-) (limited to 'tests/test.sh') 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 <