From 244808f64f0741920f381ec1462eb676343026d1 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 18 Mar 2023 22:48:48 -0500 Subject: [PATCH] Rename directive parsing phase and change tag "PV" to "PS" While there is still some syntactic validation performed during this phase, using the word "validation" for two steps seems likely to risk confusion, so this phase is renamed in the interests of clarity. The testsuite is adjusted accordingly. --- gatekeeper.pl | 4 ++-- testsuite/lib/gatekeeper.exp | 38 ++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 9b650f7..affe77f 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1602,7 +1602,7 @@ sub gather_packets { =back -=head2 [PV] Parsing and Validation +=head2 [PS] Parsing =over @@ -2854,7 +2854,7 @@ foreach my $packet (@packets) { # each list element is an array reference eval { # trap exceptions encountered while processing a packet our $Scratch_dir; our $Stage_dir; our $Public_dir; - local $Phase = 'PV'; + local $Phase = 'PS'; $directive_text = slurp_clearsigned_message (File::Spec->catfile($Scratch_dir, $packet->[0])); diff --git a/testsuite/lib/gatekeeper.exp b/testsuite/lib/gatekeeper.exp index 56339df..82f8867 100644 --- a/testsuite/lib/gatekeeper.exp +++ b/testsuite/lib/gatekeeper.exp @@ -575,115 +575,115 @@ proc analyze_log { base_dir name assess } { exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ unknown package[^\r\n]+} { # from validate_commands, when package has no config tree set A(unknown-package) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ no email list for package[^\r\n]+} { # from validate_commands, when package has no email file set A(validate,package-no-email) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid directory[^\r\n]*} { # from parse_directory_line, when the pattern match fails set A(validate,bad-directory) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ ([0-9]+) levels is too deep, in [^\r\n]+} { # from parse_directory_line, when the directory is too deep set A(validate,bad-directory-depth) 1 set A(validate,bad-directory-depth,$expect_out(1,string)) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ Only one directory directive is allowed per [^\r\n]+} { # from parse_directory_line, if directory repeated set A(validate,bad-directory-repeat) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ directive file ([^ ]+) has no signature} { # from read_directive_file, when signed message is null set A(unsigned-directive) 1 set A(unsigned-directive,$expect_out(1,string)) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid directive 'replace', not supported[^\r\n]+} { # from read_directive_file, if replace used in v1.1 set A(validate,bad-replace-flag) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ no directory element specified in [^\r\n]+} { # from read_directive_file, if no directory key found set A(validate,no-directory-given) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ nothing to do - no commands in directive file} { # from read_directive_file, if no action specified set A(validate,no-op) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid version [0-9.]+, not supported} { # from read_directive_file, if unsupported version set A(validate,bad-version) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid version [^\r\n]+} { # from read_directive_file, if unparsable version set A(validate,bad-version) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid multiple version elements} { # from read_directive_file, if version repeated set A(validate,bad-version-repeat) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ no version specified in directive} { # from read_directive_file, if no version given # This was valid in v1 but v1 is now obsolete. set A(validate,no-version) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ invalid filename [^\r\n]+} { # from read_directive_file, if filename is bogus set A(validate,bad-filename) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ 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 {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ 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 {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ Invalid directive line:[^\r\n]+} { # from read_directive_file, if a line is unrecognized set A(validate,bad-directive-line) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ no filename element in ([^\r\n]+)[.]\ Upgrade to the latest version![^\r\n]+} { # from read_directive_file, if no filename given @@ -692,7 +692,7 @@ proc analyze_log { base_dir name assess } { set A(validate,no-filename,$expect_out(1,string)) 1 exp_continue } - -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\ + -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\ filename element mismatch: [^\r\n]+} { # from read_directive_file, on name mismatch set A(validate,filename-mismatch) 1 -- 2.25.1