Skip to content

Commit

Permalink
aii-ks: fix unit tests after console fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jouvin committed Nov 2, 2016
1 parent b958ce3 commit 0e0c590
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aii-ks/src/test/perl/kickstart_logging.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ like($fh, qr{^%packages\s--ignoremissing\s--resolvedeps\n^package\n^package2\n^b
# logaction tests
my $logaction = NCM::Component::ks::log_action($cfg, 'mylogfile', 1);
like($logaction, qr{^exec\s>mylogfile\s2>&1}, 'start with exec redirection'); # no multiline search!
like($logaction, qr{^tail\s-f\smylogfile\s>\s/dev/console\s&}m, 'console logging enabled');
like($logaction, qr{^tail\s-f\smylogfile\s>\s\$console\s&}m, 'logfile displayed on console');

like($logaction, qr{^wait_for_network\slogserver}m, 'Insert sleep to make sure network is up');
like($logaction, qr{^\(tail\s-f\smylogfile.*?usleep.*?\snc\s-u\slogserver\s514\)\s&$}m, 'netcat udp logsending');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ my $logaction = NCM::Component::ks::log_action($cfg, 'mylogfile', 1);
like($logaction, qr{^exec\s>mylogfile\s2>&1}, 'start with exec redirection'); # no multiline search!

# hmm, first test might be too specific in case of subtle changes
unlike($logaction, qr{^tail\s-f\smylogfile\s>\s/dev/console\s&}m, 'no console logging enabled');
unlike($logaction, qr{/dev/console}, 'no /dev/console at all');
unlike($logaction, qr{^tail\s-f\smylogfile\s>\s\$console\s&}m, 'no console logging enabled');
unlike($logaction, qr{\$console}, 'console not defined');

unlike($logaction, qr{^\(tail\s-f\smylogfile.*?usleep.*\)\s&$}m, 'no logsending');
unlike($logaction, qr{usleep}, 'no usleep at all');
Expand Down
4 changes: 3 additions & 1 deletion aii-ks/src/test/resources/regexps/pre_noblock_logging
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ Test the logging in the pre section
---
---
^exec >/tmp/pre-log.log 2>&1$
^console='/dev/console'$
^\[ -e /dev/pts/0 \] && console='/dev/pts/0'$
^\# Make sure messages show up on the serial console$
^tail -f /tmp/pre-log.log > /dev/console &$
^tail -f /tmp/pre-log.log > \$console &$
^drainsleep=0$
^$
^echo 'Begin of pre section'$
Expand Down

0 comments on commit 0e0c590

Please sign in to comment.