check_ongoing_upload 0 1 1
check_ongoing_upload 0 0 1
+# ----------------------------------------
+
+proc check_recent_upload { recent_directive recent_main recent_signature } {
+ set tenv [new_test_environment [file join test.tmp tenv]]
+
+ set msglist {
+ start "ftp-upload start message"
+ nowork "ftp-upload 'nothing to do' message"
+
+ scan,recent.bin "scan found main file"
+ scan,recent.bin.sig "scan found signature file"
+ scan,recent.bin.directive.asc "scan found directive file"
+ }
+
+ set testcase {
+ directive {
+ version 1.2
+ filename recent.bin
+ } dsig { good 00 0000 }
+ file { recent upload } fsig { good 00 0000 }
+ }
+
+ if { $recent_directive } {
+ lappend testcase directive-mtime "15 seconds ago"
+ lappend msglist recent,recent.bin.directive.asc \
+ "skipped recent directive file"
+ } else {
+ lappend msglist consider,recent.bin.directive.asc \
+ "considered directive file"
+ }
+ if { $recent_main } {
+ lappend testcase file-mtime "15 seconds ago"
+ lappend msglist recent,recent.bin "skipped recent main file"
+ } else {
+ lappend msglist consider,recent.bin "considered main file"
+ }
+ if { $recent_signature } {
+ lappend testcase fsig-mtime "15 seconds ago"
+ lappend msglist recent,recent.bin.sig "skipped recent signature file"
+ } else {
+ lappend msglist consider,recent.bin.sig "considered signature file"
+ }
+
+ make_test_case $tenv [list recent.bin $testcase]
+
+ start_test_services $tenv
+ run_upload_batch_test
+ stop_test_services
+
+ set Name "idle processing: recent upload\
+ \[${recent_directive}${recent_main}${recent_signature}\]"
+
+ analyze_file_tree $tenv $Name {
+ incoming
+ } files { recent.bin recent.bin.sig recent.bin.directive.asc }
+ analyze_file_tree $tenv $Name {
+ in-stage stage pub archive
+ } empty
+ analyze_log $tenv $Name $msglist
+ analyze_no_mail $tenv $Name
+
+ close_test_environment $tenv
+}
+
+check_recent_upload 1 1 1
+check_recent_upload 1 0 1
+check_recent_upload 1 0 0
+check_recent_upload 1 1 0
+check_recent_upload 0 1 0
+check_recent_upload 0 1 1
+check_recent_upload 0 0 1
+
+# ----------------------------------------
+
#EOF