aboutsummaryrefslogtreecommitdiff
path: root/tests/submit/submit-pub.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/submit/submit-pub.testscript')
-rw-r--r--tests/submit/submit-pub.testscript52
1 files changed, 40 insertions, 12 deletions
diff --git a/tests/submit/submit-pub.testscript b/tests/submit/submit-pub.testscript
index 78c42b6..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
{
@@ -84,14 +84,8 @@ clone_root_rep = cp --no-cleanup -r $root_rep ./ &pkg-1/*** &?pkg.lock
$clone_root_rep;
ln -s pkg-1 pkg;
- # Add the libhello/0.1.0+1 package revision to the repository.
+ # Initial submission.
#
- mkdir --no-cleanup pkg-1/1/hello;
- tar -xf $~/$data_dir/libhello-0.1.0.tar.gz &libhello-0.1.0/***;
- 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 pkg-1/1/hello/libhello-0.1.0+1.tar.gz libhello-0.1.0+1;
-
$* $~/pkg $~/$data_dir &!pkg-1/*** &pkg-*/*** >>"EOO";
: 1
status: 200
@@ -99,7 +93,6 @@ 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+1.tar.gz == 1;
test -f pkg/1/hello/libhello-0.1.0.tar.gz;
# While at it, test the duplicate submission.
@@ -113,7 +106,42 @@ 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
+ 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
@@ -154,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
%.+
\\
@@ -175,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
%.+
\\