Add test for rejection of uploaded file with future timestamp
authorJacob Bachmeyer <jcb@gnu.org>
Sun, 13 Nov 2022 05:30:20 +0000 (23:30 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Sun, 13 Nov 2022 05:30:20 +0000 (23:30 -0600)
testsuite/gatekeeper.all/03_triplet.exp

index 953141b44b62db2df31049af72a1096155bd7c2f..310852bbb959371a8f6dbd6ac57c4c9394565e5b 100644 (file)
@@ -457,6 +457,41 @@ check_triplet "bogus: directive signature from the future" setup {
     }
 }
 
+check_triplet "bogus: file signature from the future" setup {
+    packages {
+       foo {
+           email { "foo@example.org" }
+           keys { { id 1000 name "foo <foo@example.gnu.org>" } }
+           maintainers { "foo <foo@example.net>" }
+       }
+    }
+} upload {
+    foo.bin {
+       directive {
+           version 1.2
+           directory foo
+           filename foo.bin
+       } dsig { good 05 1000 }
+       file { test } fsig { good 06 1000 "3 days" }
+    }
+} check {
+    file-tree {
+       { incoming stage pub archive } empty {}
+       { in-stage } files {
+           .foo.bin.directive.asc .foo.bin.sig .foo.bin
+       }
+    } log {
+       found,foo.bin.directive.asc "found directive in triplet"
+       found-packet,foo.bin.directive.asc:foo.bin.sig:foo.bin \
+           "found triplet"
+       validate,future-signature-timestamp \
+           "reject upload from the future"
+    } email-to {
+       ftp-upload-script@gnu.org foo@example.gnu.org
+       ftp-upload-report@gnu.org foo@example.org foo@example.net
+    }
+}
+
 check_triplet "bogus: signed with wrong key" setup {
     packages {
        foo {