set A(skip-loose,$expect_out(1,string)) 1
exp_continue
}
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ directive file \(([^ ]+)\) larger than[^\r\n]+} {
+ # from scan_incoming, on finding an oversize directive
+ set A(oversize-directive,$expect_out(1,string)) 1
+ exp_continue
+ }
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ The directive file [^ ]+ is larger than[^\r\n]+} {
+ # from scan_incoming, on finding an oversize directive
+ # already noted above; both messages are produced
+ exp_continue
+ }
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ signature file \(([^ ]+)\) larger than[^\r\n]+} {
+ # from scan_incoming, on finding an oversize signature
+ set A(oversize-signature,$expect_out(1,string)) 1
+ exp_continue
+ }
+ -re {^ftp-upload\[[0-9]+\]: \(Test\)\
+ The signature file [^ ]+ is larger than[^\r\n]+} {
+ # from scan_incoming, on finding an oversize signature
+ # already noted above; both messages are produced
+ exp_continue
+ }
-re {^ftp-upload\[[0-9]+\]: \(Test\)\
DEBUG: found keyring [^\r\n]+} {
# ----------------------------------------
+proc check_oversize_part { oversize_directive oversize_signature } {
+ set tenv [new_test_environment [file join test.tmp tenv]]
+
+ set msglist {
+ start "ftp-upload start message"
+
+ scan,oversize.bin "scan found main file"
+ consider,oversize.bin "considered main file"
+ scan,oversize.bin.sig "scan found signature file"
+ scan,oversize.bin.directive.asc "scan found directive file"
+ }
+
+ set filelist { oversize.bin }
+
+ make_test_case $tenv {
+ oversize.bin {
+ directive {
+ version 1.2
+ filename oversize.bin
+ directory oversize
+ } dsig { good 00 0000 }
+ file { oversize auxiliary test } fsig { good 00 0000 }
+ }
+ }
+ if { $oversize_directive } {
+ set chan [open [file join $tenv incoming oversize.bin.directive.asc] a]
+ puts $chan [string repeat \
+ "[string repeat { bogon } 11]\n" 1024]
+ close $chan
+ age_file [file join $tenv incoming oversize.bin.directive.asc] \
+ "3 minutes ago"
+ lappend msglist oversize-directive,oversize.bin.directive.asc \
+ "detected oversize directive file"
+ lappend filelist .oversize.bin.directive.asc
+ } else {
+ lappend filelist oversize.bin.directive.asc
+ }
+ if { $oversize_signature } {
+ set chan [open [file join $tenv incoming oversize.bin.sig] a]
+ puts $chan [string repeat \
+ "[string repeat { bogon } 11]\n" 1024]
+ close $chan
+ age_file [file join $tenv incoming oversize.bin.sig] \
+ "3 minutes ago"
+ if { ! $oversize_directive } {
+ # a signature will not be checked if the directive is oversize
+ # TODO: fix this so both will be reported if appropriate
+ lappend msglist oversize-signature,oversize.bin.sig \
+ "detected oversize signature file"
+ lappend filelist .oversize.bin.sig
+ } else {
+ lappend filelist oversize.bin.sig
+ }
+ } else {
+ lappend filelist oversize.bin.sig
+ }
+
+ start_test_services $tenv
+ run_upload_batch_test
+ stop_test_services
+
+ set Name "idle processing: oversize directive/signature\
+ \[${oversize_directive}${oversize_signature}\]"
+
+ analyze_file_tree $tenv $Name {
+ incoming
+ } files $filelist
+ analyze_file_tree $tenv $Name {
+ in-stage stage pub archive
+ } empty
+ analyze_log $tenv $Name $msglist
+ analyze_mail $tenv $Name to { ftp-upload-script@gnu.org }
+
+ close_test_environment $tenv
+}
+
+check_oversize_part 1 1
+check_oversize_part 1 0
+check_oversize_part 0 1
+
#EOF