From 4fb7c6f1c2af6f218de2dc3a233ec20c27e7dc88 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Wed, 26 Jan 2022 21:10:49 -0600 Subject: [PATCH] Add idle processing tests for recent uploads --- testsuite/upload.all/00_idle.exp | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/testsuite/upload.all/00_idle.exp b/testsuite/upload.all/00_idle.exp index a699845..9085b1c 100644 --- a/testsuite/upload.all/00_idle.exp +++ b/testsuite/upload.all/00_idle.exp @@ -275,4 +275,78 @@ check_ongoing_upload 0 1 0 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 -- 2.25.1