}
-re {^ftp-upload\[[0-9]+\]: \(Test\)\
invalid version [0-9.]+, not supported} {
- # from read_directive_file, if bad version
+ # from read_directive_file, if unsupported version
+ set A(validate,bad-version) 1
+ exp_continue
+ }
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ invalid version [^\r\n]+} {
+ # from read_directive_file, if unparsable version
set A(validate,bad-version) 1
exp_continue
}
set A(validate,no-version,$expect_out(1,string)) 1
exp_continue
}
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ invalid filename [^\r\n]+} {
+ # from read_directive_file, if filename is bogus
+ set A(validate,bad-filename) 1
+ exp_continue
+ }
-re {^ftp-upload\[[0-9]+\]: \(Test\)\
Only one filename directive is allowed per [^\r\n]+} {
# from read_directive_file, if filename repeated
set A(validate,bad-filename-repeat) 1
exp_continue
}
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ invalid parameters for ([^ ]+) command[^\r\n]+} {
+ # from read_directive_file, when most commands have
+ # unrecognized or invalid parameters
+ set A(validate,bad-parameter,$expect_out(1,string)) 1
+ exp_continue
+ }
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ Invalid directive line:[^\r\n]+} {
+ # from read_directive_file, if a line is unrecognized
+ set A(validate,bad-directive-line) 1
+ exp_continue
+ }
-re {^ftp-upload\[[0-9]+\]: \(Test\)\
no filename directive specified in ([^\r\n]+)[.]\
Upgrade to the latest version![^\r\n]+} {
}
}
+check_triplet "bogus: directive with unknown key" 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
+ filename foo.bin
+ directory foo
+ bogus-key-name bogus!
+ } dsig { good 03 1000 }
+ file { test } fsig { good 04 1000 }
+ }
+} check {
+ file-tree {
+ { incoming stage pub archive } empty {}
+ { in-stage } files {
+ foo.bin foo.bin.sig foo.bin.directive.asc
+ }
+ } log {
+ found,foo.bin.directive.asc "found directive in triplet"
+ found-triplet,foo.bin.directive.asc:foo.bin.sig:foo.bin \
+ "found triplet"
+ validate,bad-directive-line "bogus directive line detected"
+ } email-to {
+ ftp-upload-script@gnu.org foo@example.gnu.org
+ foo@example.org foo@example.net
+ }
+}
+
check_triplet "bogus: signed for unknown package" setup {
packages {
foo {
# ----------------------------------------
+check_triplet "bogus: version field not a number" 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 bogus
+ directory foo
+ filename foo.bin
+ } dsig { good 00 1000 }
+ file { test } fsig { good 01 1000 }
+ }
+} 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-triplet,foo.bin.directive.asc:foo.bin.sig:foo.bin \
+ "found triplet"
+ validate,bad-version "invalid version rejected"
+ } email-to {
+ ftp-upload-script@gnu.org foo@example.gnu.org
+ }
+}
+
# version 1.0 did not use the version field at all
check_triplet "bogus: invalid v1.0 format directive" setup {
packages {
}
}
+ check_triplet "bogus: v$FVER format directive with bogus filename" setup {
+ packages {
+ foo {
+ email { "foo@example.org" }
+ keys { { id 1000 name "foo <foo@example.gnu.org>" } }
+ maintainers { "foo <foo@example.net>" }
+ }
+ }
+ } upload [subst {
+ foo.bin {
+ directive {
+ version $FVER
+ filename -bogus=filename
+ directory foo/v$FVER
+ } dsig { good 04 1000 }
+ file { test } fsig { good 05 1000 }
+ }
+ }] 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-triplet,foo.bin.directive.asc:foo.bin.sig:foo.bin \
+ "found triplet"
+ validate,bad-filename \
+ "directive file with bogus filename rejected"
+ } email-to {
+ ftp-upload-script@gnu.org foo@example.gnu.org
+ }
+ }
+
check_triplet "bogus: v$FVER format directive with repeated filename" setup {
packages {
foo {
}
}]
-
check_triplet "v$FVER format directive with subtree key at top" setup {
packages {
foo {
}
}
+check_triplet "bogus: v1.2 format directive with bogus replace value" setup {
+ packages {
+ foo {
+ email { "foo@example.org" }
+ keys { { id 1000 name "foo <foo@example.gnu.org>" } }
+ maintainers { "foo <foo@example.net>" }
+ }
+ }
+ files {
+ pub { foo/foo.bin { good 01 1000 } }
+ }
+} upload {
+ foo.bin {
+ directive {
+ version 1.2
+ replace bogus!
+ filename foo.bin
+ directory foo
+ } dsig { good 0E 1000 }
+ file { test } fsig { good 0F 1000 }
+ }
+} check {
+ file-tree {
+ { incoming stage archive } empty {}
+ { in-stage } files {
+ foo.bin.directive.asc foo.bin.sig foo.bin
+ }
+ { pub } files {
+ foo/foo.bin foo/foo.bin.sig
+ }
+ } log {
+ found,foo.bin.directive.asc "found directive in triplet"
+ found-triplet,foo.bin.directive.asc:foo.bin.sig:foo.bin \
+ "found triplet"
+ validate,bad-parameter,replace \
+ "invalid replace flag value rejected"
+ } email-to {
+ ftp-upload-script@gnu.org foo@example.gnu.org
+ }
+}
+
# ----------------------------------------
#EOF