Test suite: Improve error handling for non-existant log files
This commit is contained in:
parent
8334473887
commit
f8273783da
@ -8179,12 +8179,14 @@ sub file_find_regex() {
|
||||
return 0 if $tries == 5;
|
||||
}
|
||||
|
||||
open RE, "< $file" or
|
||||
(&write_test_file("[-] Could not open $file: $!\n", $curr_test_file) and return 0);
|
||||
if (open (RE, "<", $file)) {
|
||||
while (<RE>) {
|
||||
push @file_lines, $_;
|
||||
}
|
||||
close RE;
|
||||
} else {
|
||||
&write_test_file("[-] Could not open $file: $!\n", $curr_test_file) and return 0;
|
||||
}
|
||||
|
||||
for my $re (@$re_ar) {
|
||||
my $matched = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user