diff options
Diffstat (limited to 'tests/submit/submit-pub.testscript')
-rw-r--r-- | tests/submit/submit-pub.testscript | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/tests/submit/submit-pub.testscript b/tests/submit/submit-pub.testscript index b73d108..8c042a7 100644 --- a/tests/submit/submit-pub.testscript +++ b/tests/submit/submit-pub.testscript @@ -17,7 +17,7 @@ root_rep=$~/pkg-1 +echo ": 1" >=$root_rep/1/repositories.manifest +bpkg rep-create $root_rep/1 2>! &$root_rep/1/packages.manifest -clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock +clone_root_rep = [cmdline] cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock : args { @@ -76,7 +76,7 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock : for-real : - : Here we create the (fake) package revision which is expected to be removed + : Here we also create the package revision which is expected to be removed : by the handler. : { @@ -84,9 +84,8 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock $clone_root_rep; ln -s pkg-1 pkg; - mkdir --no-cleanup pkg-1/1/prj; - touch --no-cleanup pkg-1/1/prj/libhello-0.1.0+1.tar.gz; - + # Initial submission. + # $* $~/pkg $~/$data_dir &!pkg-1/*** &pkg-*/*** >>"EOO"; : 1 status: 200 @@ -94,16 +93,55 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock reference: $checksum EOO + test -f pkg/1/hello/libhello-0.1.0.tar.gz; + # While at it, test the duplicate submission. # $clone_root_data_clean; - $* $~/pkg $~/$data_dir >>"EOO" + $* $~/pkg $~/$data_dir >>"EOO"; : 1 status: 422 message: duplicate submission reference: $checksum EOO + + test -f pkg/1/hello/libhello-0.1.0.tar.gz; + + # Revision submission. + # + # Here we test that the handler removes the previous revision. + # + tar -xf $~/$data_dir/libhello-0.1.0.tar.gz; + sed -i -e 's/(version: 0.1.0)/\1+1/' libhello-0.1.0/manifest; + mv libhello-0.1.0 libhello-0.1.0+1; + tar cfz $~/$data_dir/libhello-0.1.0+1.tar.gz libhello-0.1.0+1; + rm -r libhello-0.1.0+1; + rm $~/$data_dir/libhello-0.1.0.tar.gz; + sed -i -e 's/(archive: libhello-0.1.0)(.tar.gz)/\1+1\2/' $data_dir/request.manifest; + + $* $~/pkg $~/$data_dir >>"EOO"; + : 1 + status: 200 + message: package is published: libhello/0.1.0+1 + reference: $checksum + EOO + + test -f pkg/1/hello/libhello-0.1.0.tar.gz == 1; + test -f pkg/1/hello/libhello-0.1.0+1.tar.gz; + + # While at it, test the older revision submission. + # + $clone_root_data_clean; + + $* $~/pkg $~/$data_dir >>"EOO"; + : 1 + status: 422 + message: newer revision libhello/0.1.0+1 is present + reference: $checksum + EOO + + test -f pkg/1/hello/libhello-0.1.0+1.tar.gz } : result-url @@ -144,7 +182,7 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock $* $~/brep-loader $~/pkg $~/$data_dir >>~"%EOO%" : 1 status: 400 - message: \\ + message:\\ submitted archive is not a valid package %.+ \\ @@ -165,7 +203,7 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock $* $~/brep-loader $~/pkg $~/$data_dir >>~"%EOO%" : 1 status: 400 - message: \\ + message:\\ unable to add package to repository %.+ \\ |