Skip to content

Commit

Permalink
Prepare for GREP 3.8
Browse files Browse the repository at this point in the history
egrep and fgrep have been deprecated in favor of grep -E and grep -F for a long time
grep 3.8 starts spitting out deprecation warnings whenever being invoked as egre/fgrep

Handle that by replacing all calls to egrep/fgrep with grep -E, resp grep -F

> grep egrep . -rl | xargs sed -i "s|egrep|grep -E|g"
> grep fgrep . -rl | xargs sed -i "s|fgrep|grep -F|g"
  • Loading branch information
DimStar77 committed Oct 21, 2022
1 parent 4a3524d commit 45953f7
Show file tree
Hide file tree
Showing 38 changed files with 66 additions and 66 deletions.
Binary file modified data/busybox-sparc
Binary file not shown.
4 changes: 2 additions & 2 deletions data/console/test_openssl_nodejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ main(){
fi

# Get list of each nodejs version found from default repo
local NODE_VERSIONS=$(zypper -n search nodejs | egrep -i 'nodejs[0-9]{1,2} ' | cut -d'|' -f 2 | tr -d ' '| tr -d 'nodejs' | sort -h -u)
local NODE_LATEST_VERSION=$(zypper -n search nodejs | egrep -i 'nodejs[0-9]{1,2} ' | cut -d'|' -f 2 | tr -d ' '| tr -d 'nodejs' | sort -h -u | tail -n1)
local NODE_VERSIONS=$(zypper -n search nodejs | grep -E -i 'nodejs[0-9]{1,2} ' | cut -d'|' -f 2 | tr -d ' '| tr -d 'nodejs' | sort -h -u)
local NODE_LATEST_VERSION=$(zypper -n search nodejs | grep -E -i 'nodejs[0-9]{1,2} ' | cut -d'|' -f 2 | tr -d ' '| tr -d 'nodejs' | sort -h -u | tail -n1)

for v in $NODE_VERSIONS; do
echo "Found node version: $v"
Expand Down
22 changes: 11 additions & 11 deletions data/qam/mdadm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function breakdown
rungrepdebug "/dev/loop42" lsof

# safety, in case we got interrupted halfway through
mount | fgrep $tempmnt && umount $tempmnt
mount | grep -F $tempmnt && umount $tempmnt
if [ -e $MD_DEVICE ] ; then mdadm --stop $MD_DEVICE ; fi
for i in 1 2 3 ; do if losetup $(eval echo \$DEV_$i) >/dev/null 2>&1 ; then run losetup -d $(eval echo \$DEV_$i) ; fi ; done

Expand Down Expand Up @@ -154,7 +154,7 @@ rungrep "1.(5|49) GiB" fdisk -l $MD_DEVICE
rungrep "Creating filesystem with" mkfs.ext4 $MD_DEVICE

run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

run dd if=/dev/urandom of=random_data.raw bs=100M count=1

Expand All @@ -177,7 +177,7 @@ run mdadm --detail --scan >/var/tmp/mdadm.sh.conf
run mdadm --stop $MD_DEVICE
run mdadm --assemble --scan --config=/var/tmp/mdadm.sh.conf
run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

for i in $(seq -w 1 $RANDOM_DATA_COPY_COUNT)
do
Expand Down Expand Up @@ -235,7 +235,7 @@ rungrep "510 MiB" fdisk -l $MD_DEVICE
rungrep "Creating filesystem with" mkfs.ext4 $MD_DEVICE

run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

run dd if=/dev/urandom of=random_data.raw bs=100M count=1

Expand All @@ -255,7 +255,7 @@ done

run mdadm $MD_DEVICE --fail $DEV_2

rungrep "clean, degraded" mdadm --detail $MD_DEVICE | fgrep "State :"
rungrep "clean, degraded" mdadm --detail $MD_DEVICE | grep -F "State :"

rungrep "\[1\]\(F\)" cat /proc/mdstat

Expand Down Expand Up @@ -310,7 +310,7 @@ done

rungrep "UUU" cat /proc/mdstat

rungrep "clean" mdadm --detail $MD_DEVICE | fgrep "State :"
rungrep "clean" mdadm --detail $MD_DEVICE | grep -F "State :"

for i in $(seq -w 1 $RANDOM_DATA_COPY_COUNT)
do
Expand All @@ -322,7 +322,7 @@ run mdadm --detail --scan > /var/tmp/mdadm.sh.conf
run mdadm --stop $MD_DEVICE
run mdadm --assemble --scan --config=/var/tmp/mdadm.sh.conf
run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

for i in $(seq -w 1 $RANDOM_DATA_COPY_COUNT)
do
Expand Down Expand Up @@ -380,7 +380,7 @@ rungrep "1020 MiB" fdisk -l $MD_DEVICE
rungrep "Creating filesystem with" mkfs.ext4 $MD_DEVICE

run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

run dd if=/dev/urandom of=random_data.raw bs=100M count=1

Expand All @@ -400,7 +400,7 @@ done

run mdadm $MD_DEVICE --fail $DEV_1

rungrep "clean, degraded" mdadm --detail $MD_DEVICE | fgrep "State :"
rungrep "clean, degraded" mdadm --detail $MD_DEVICE | grep -F "State :"

rungrep "\[0\]\(F\)" cat /proc/mdstat

Expand Down Expand Up @@ -444,7 +444,7 @@ done

rungrep "UUU" cat /proc/mdstat

rungrep "clean" mdadm --detail $MD_DEVICE | fgrep "State :"
rungrep "clean" mdadm --detail $MD_DEVICE | grep -F "State :"

for i in $(seq -w 1 $RANDOM_DATA_COPY_COUNT)
do
Expand All @@ -456,7 +456,7 @@ run mdadm --detail --scan > /var/tmp/mdadm.sh.conf
run mdadm --stop $MD_DEVICE
run mdadm --assemble --scan --config=/var/tmp/mdadm.sh.conf
run mount $MD_DEVICE $tempmnt
mount | fgrep -q $tempmnt || exit 1
mount | grep -F -q $tempmnt || exit 1

for i in $(seq -w 1 $RANDOM_DATA_COPY_COUNT)
do
Expand Down
4 changes: 2 additions & 2 deletions data/s390x/TOOL_s390_chccwdev/chccwdev_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ call_lscss(){
y="$(lscss -t 3390/0C,1732/01 | wc -l)";
y="$(( y - 2))";

if [[ "$(lscss | egrep -i '1732/01|3390/0C' | wc -l)" -eq $y ]]
if [[ "$(lscss | grep -E -i '1732/01|3390/0C' | wc -l)" -eq $y ]]
then
echo "lscss -t 3390/0C,1732/01"
sleep 2
Expand All @@ -70,7 +70,7 @@ call_lscss(){

y="$(lscss -s -t 3390/0C,1732/01 | wc -l )";
y="$(( y - 2 ))";
x="$(lscss -s | egrep -i '1732/01|3390/0C' | wc -l)";
x="$(lscss -s | grep -E -i '1732/01|3390/0C' | wc -l)";
#x=`expr $x - 2`

if [[ $x -eq $y ]]
Expand Down
4 changes: 2 additions & 2 deletions data/s390x/TOOL_s390_chccwdev/lscss_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function call_lscss(){
y=`lscss -t 3390/0C,1732/01 | wc -l`
y=`expr $y - 2`

if [[ `lscss | egrep -i '1732/01|3390/0C' | wc -l` -eq $y ]]
if [[ `lscss | grep -E -i '1732/01|3390/0C' | wc -l` -eq $y ]]
then
echo "lscss -t 3390/0C,1732/01"
sleep 2
Expand All @@ -65,7 +65,7 @@ function call_lscss(){

y=`lscss -s -t 3390/0C,1732/01 | wc -l `
y=`expr $y - 2`
x=`lscss -s | egrep -i '1732/01|3390/0C' | wc -l`
x=`lscss -s | grep -E -i '1732/01|3390/0C' | wc -l`
#x=`expr $x - 2`

if [[ $x -eq $y ]]
Expand Down
2 changes: 1 addition & 1 deletion data/shar_testdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lock_dir=_sh05593
# 92 -rw-r--r-- shar_testdata/hallo.txt
#
MD5SUM=${MD5SUM-md5sum}
f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'`
f=`${MD5SUM} --version | grep -E '^md5sum .*(core|text)utils'`
test -n "${f}" && md5check=true || md5check=false
${md5check} || \
echo 'Note: not verifying md5sums. Consider installing GNU coreutils.'
Expand Down
2 changes: 1 addition & 1 deletion lib/audit_test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ sub _parse_results_with_diff_baseline {
#
sub rerun_fail_cases {
my $fail_case = shift;
my $output = script_output('egrep "FAIL|ERROR" rollup.log', proceed_on_failure => 1);
my $output = script_output('grep -E "FAIL|ERROR" rollup.log', proceed_on_failure => 1);
return if ($output eq '');

my @lines = split(/\n/, $output);
Expand Down
2 changes: 1 addition & 1 deletion lib/hacluster.pm
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ sub check_cluster_state {
$cmd->("$crm_mon_cmd | grep -i 'no inactive resources'") if is_sle '12-sp3+';
$cmd->('crm_mon -1 | grep \'partition with quorum\'');
# In older versions, node names in crm node list output are followed by ": normal". In newer ones by ": member"
$cmd->(q/crm_mon -s | grep "$(crm node list | egrep -c ': member|: normal') nodes online"/);
$cmd->(q/crm_mon -s | grep "$(crm node list | grep -E -c ': member|: normal') nodes online"/);
# As some options may be deprecated, test shouldn't die on 'crm_verify'
if (get_var('HDDVERSION')) {
script_run 'crm_verify -LV';
Expand Down
2 changes: 1 addition & 1 deletion lib/mr_test_run.pm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub test_bsc1152598 {
assert_script_run
'echo -e "[version]\n# foobar-NOTE=foobar CATEGORY=foobar VERSION=0 DATE=foobar NAME=\" foobar \"\n[block]\nIO_SCHEDULER=foobar, noop, none\n" > /etc/saptune/extra/scheduler-test.conf';
$self->wrap_script_run('saptune note apply scheduler-test');
$self->wrap_script_run("egrep -q '\[(noop|none)\]' /sys/block/sda/queue/scheduler");
$self->wrap_script_run("grep -E -q '\[(noop|none)\]' /sys/block/sda/queue/scheduler");
$self->wrap_script_run("mr_test verify Pattern/${SLE}/testpattern_bsc1152598#1_2");
$self->wrap_script_run("saptune revert all");

Expand Down
8 changes: 4 additions & 4 deletions lib/services/sshd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ my $ssh_testman_passwd = get_var('PUBLIC_CLOUD') ? random_string(8) : 'let3me2in
my $changepwd = $ssh_testman . ":" . $ssh_testman_passwd;

sub check_sshd_port {
assert_script_run q(ss -pnl4 | egrep 'tcp.*LISTEN.*:22.*sshd');
assert_script_run q(ss -pnl6 | egrep 'tcp.*LISTEN.*:22.*sshd');
assert_script_run q(ss -pnl4 | grep -E 'tcp.*LISTEN.*:22.*sshd');
assert_script_run q(ss -pnl6 | grep -E 'tcp.*LISTEN.*:22.*sshd');
}

sub check_sshd_service {
Expand Down Expand Up @@ -82,7 +82,7 @@ sub ssh_basic_check {

# Check that we are really in the SSH session
assert_script_run 'echo $SSH_TTY | grep "\/dev\/pts\/"';
assert_script_run 'ps ux | egrep ".* \? .* sshd\:"';
assert_script_run 'ps ux | grep -E ".* \? .* sshd\:"';
assert_script_run "whoami | grep $ssh_testman";
assert_script_run "mkdir .ssh";

Expand All @@ -105,7 +105,7 @@ sub ssh_basic_check {
assert_script_run "echo 'sshd.pm: Testing port forwarding' | logger";
background_script_run "ssh -vNL 4242:localhost:22 $ssh_testman\@localhost 2>/tmp/ssh_log1";
background_script_run "ssh -vNR 0.0.0.0:5252:localhost:22 $ssh_testman\@localhost 2>/tmp/ssh_log2";
assert_script_run 'until ss -tulpn|grep sshd|egrep "4242|5252";do sleep 1;done';
assert_script_run 'until ss -tulpn|grep sshd|grep -E "4242|5252";do sleep 1;done';

# Scan public keys on forwarded ports
# Add a workaround about bsc#1193275 in FIPS test
Expand Down
4 changes: 2 additions & 2 deletions lib/sles4sap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ sub check_instance_state {
last if (($output =~ /GRAY/) && ($uc_state eq 'GRAY'));

if ((($output =~ /GREEN/) && ($uc_state eq 'GREEN')) || ($uc_state eq 'GRAY')) {
$output = script_output "sapcontrol -nr $instance -function GetProcessList | egrep -i ^[a-z]", proceed_on_failure => 1;
$output = script_output "sapcontrol -nr $instance -function GetProcessList | grep -E -i ^[a-z]", proceed_on_failure => 1;
die "sapcontrol: GetProcessList: command failed" unless ($output =~ /GetProcessList[\r\n]+OK/);

my $failing_services = 0;
Expand Down Expand Up @@ -739,7 +739,7 @@ sub do_hana_takeover {
save_state;
$self->check_replication_state;
$self->check_hanasr_attr;
script_run 'egrep "expected_votes|two_node" /etc/corosync/corosync.conf';
script_run 'grep -E "expected_votes|two_node" /etc/corosync/corosync.conf';
$self->do_hana_sr_register(node => $args{node});
}
sleep bmwqemu::scale_timeout(10);
Expand Down
2 changes: 1 addition & 1 deletion lib/swtpmtest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sub swtpm_verify {
if (!is_sle('<15-SP4')) {
# Measured boot check
# If measured boot works fine, it can record available algorithms and pcrs
assert_script_run("cat $result_file | egrep 'AlgorithmId|pcrs'");
assert_script_run("cat $result_file | grep -E 'AlgorithmId|pcrs'");
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/transactional.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ sub check_reboot_changes {
my $time = time;
my $mounted = "mnt-$time";
my $default = "def-$time";
assert_script_run "mount | grep 'on / ' | egrep -o 'subvolid=[0-9]*' | cut -d'=' -f2 > $mounted";
assert_script_run "mount | grep 'on / ' | grep -E -o 'subvolid=[0-9]*' | cut -d'=' -f2 > $mounted";
assert_script_run "btrfs su get-default / | cut -d' ' -f2 > $default";
my $change_happened = script_run "diff $mounted $default";

Expand Down Expand Up @@ -287,7 +287,7 @@ are changes happened.

sub reboot_on_changes {
# Compare currently mounted and default subvolume
my $mountedsubvol = script_output("mount | grep 'on / ' | egrep -o 'subvolid=[0-9]*' | cut -d'=' -f2", proceed_on_failure => 0);
my $mountedsubvol = script_output("mount | grep 'on / ' | grep -E -o 'subvolid=[0-9]*' | cut -d'=' -f2", proceed_on_failure => 0);
my $defaultsubvol = script_output("btrfs su get-default / | cut -d' ' -f2", proceed_on_failure => 0);
my $has_change = abs(int($defaultsubvol) - int($mountedsubvol));

Expand Down
4 changes: 2 additions & 2 deletions lib/y2lan_restart_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sub initialize_y2lan
'(WICKED_LOG_LEVEL).*/\1="info"'; # DEBUG configuration for wicked
assert_script_run 'sed -i -E \'s/' . $debug_conf . '/\' /etc/sysconfig/network/config';
assert_script_run 'systemctl restart network';
enter_cmd "journalctl -f -o short-precise|egrep -i --line-buffered '$query_pattern_for_restart|Reloaded wicked' > journal.log &";
enter_cmd "journalctl -f -o short-precise|grep -E -i --line-buffered '$query_pattern_for_restart|Reloaded wicked' > journal.log &";
clear_journal_log();
}

Expand Down Expand Up @@ -227,7 +227,7 @@ Run record_soft_failure for bsc#1115644 if C<$args> has not been found in /etc/h
sub validate_etc_hosts_entry {
my (%args) = @_;

script_run("egrep \"@{[$args{ip}]}\\s@{[$args{fqdn}]}\\s@{[$args{host}]}\" /etc/hosts", 30)
script_run("grep -E \"@{[$args{ip}]}\\s@{[$args{fqdn}]}\\s@{[$args{host}]}\" /etc/hosts", 30)
&& record_soft_failure "bsc#1115644 Expected entry:\n \"@{[$args{ip}]} @{[$args{fqdn}]} @{[$args{host}]}\" was not found in /etc/hosts";
script_run "cat /etc/hosts";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/autoyast/wicked.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sub run {
enter_cmd "mkdir /tmp/wicked";
# enable debugging
enter_cmd "perl -i -lpe 's{^(WICKED_DEBUG)=.*}{\$1=\"all\"};s{^(WICKED_LOG_LEVEL)=.*}{\$1=\"debug\"}' /etc/sysconfig/network/config";
enter_cmd "egrep \"WICKED_DEBUG|WICKED_LOG_LEVEL\" /etc/sysconfig/network/config";
enter_cmd "grep -E \"WICKED_DEBUG|WICKED_LOG_LEVEL\" /etc/sysconfig/network/config";
# restart the daemons
enter_cmd "systemctl restart wickedd";
save_screenshot;
Expand Down
4 changes: 2 additions & 2 deletions tests/console/avocado_prepare.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ sed -i 's/timeout=360/timeout=20/' /var/lib/avocado/data/avocado-vt/test-provide
sed -i 's/timeout=90/timeout=20/' /var/lib/avocado/data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/qemu/tests/nic_hotplug.py
sed -i 's/ip, 10,/ip, 3,/' /var/lib/avocado/data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/qemu/tests/nic_hotplug.py
sed -i 's/boot_menu_key = "f12"/boot_menu_key = "esc"/' /var/lib/avocado/data/avocado-vt/backends/qemu/cfg/subtests.cfg
egrep "^arch|^nettype|^netdst|^backup_image_before_test|^restore_image_after_test" /etc/avocado/conf.d/vt.conf
egrep ^login_timeout /var/lib/avocado/data/avocado-vt/backends/qemu/cfg/base.cfg
grep -E "^arch|^nettype|^netdst|^backup_image_before_test|^restore_image_after_test" /etc/avocado/conf.d/vt.conf
grep -E ^login_timeout /var/lib/avocado/data/avocado-vt/backends/qemu/cfg/base.cfg
systemctl start openvswitch.service
systemctl status openvswitch.service
EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/console/bind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ sub run {

sub post_fail_hook {
# print out what tests failed
assert_script_run 'egrep "^A|^R" systests.output|grep -B1 FAIL';
assert_script_run 'grep -E "^A|^R" systests.output|grep -B1 FAIL';
upload_logs 'systests.output';
}

Expand Down
2 changes: 1 addition & 1 deletion tests/console/journalctl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub verify_journal {
# upstream issue
# https://github.com/systemd/systemd/issues/17833
record_soft_failure 'bsc#1171858 - journal corruption: "tag/entry realtime timestamp out of synchronization"';
} elsif (defined($fss_key) && (script_run("egrep 'No sealing yet,.*of entries not sealed.' errs") == 0)) {
} elsif (defined($fss_key) && (script_run("grep -E 'No sealing yet,.*of entries not sealed.' errs") == 0)) {
die "Sealing is not working!\n";
# Check for https://bugzilla.suse.com/show_bug.cgi?id=1178193, a race condition for `journalctl --verify`
} elsif (script_run("grep 'File corruption detected' errs") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/console/validate_lvm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub run {
fail_message => 'LVM config validation failed');

record_info('LVM volume', 'Verify the LVM physical volume(s) exists');
assert_script_run('lvmdiskscan -v | egrep "LVM physical volume?$"',
assert_script_run('lvmdiskscan -v | grep -E "LVM physical volume?$"',
fail_message => 'LVM physical volume does not exist.');

record_info('ACTIVE volumes', 'Verify all Logical Volumes are ACTIVE');
Expand Down
2 changes: 1 addition & 1 deletion tests/console/verify_efi_mok.pm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ sub run {
## Keep previous configuration
$self->verification('After pbl reinit', $exp_data, sub {
my $state = !get_var('DISABLE_SECUREBOOT', 0) ? 'yes' : 'no';
assert_script_run(q|egrep "SECURE_BOOT=['\"]?| . $state . q|[\"']?" | . SYSCONFIG_BOOTLADER);
assert_script_run(q|grep -E "SECURE_BOOT=['\"]?| . $state . q|[\"']?" | . SYSCONFIG_BOOTLADER);
assert_script_run 'update-bootloader --reinit';
}
);
Expand Down
2 changes: 1 addition & 1 deletion tests/console/verify_network.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub run {
qw(network_manager device config_files)};

# check device UP (or UNKNOWN for some machines)
if (script_run("ip link show dev $dev | egrep 'state (UP|UNKNOWN)'")) {
if (script_run("ip link show dev $dev | grep -E 'state (UP|UNKNOWN)'")) {
die "Network device '$dev' should be UP (or UNKNOWN)";
}
# check IPv6 addresses in use
Expand Down
2 changes: 1 addition & 1 deletion tests/console/verify_systemd_timesync.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub run {
my $not_synced = 1;
{
do {
$not_synced = script_run("journalctl -u yast-timesync | egrep \"Started\|Finished One time sync configured by YaST\"");
$not_synced = script_run("journalctl -u yast-timesync | grep -E \"Started\|Finished One time sync configured by YaST\"");
last unless ($not_synced);
$uptime = script_output("uptime | cut -c19,20");
script_run("echo \"Waiting 10 seconds before rechecking logs for One time synchronization\"");
Expand Down
2 changes: 1 addition & 1 deletion tests/console/yast2_rmt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sub test_config {
for (@unit) {
script_run("systemctl is-active $_") && die "The systemd unit $_ is not active";
}
assert_script_run("firewall-cmd --list-services |egrep 'http[[:space:]]https'", fail_message => 'The firewall ports are not opened');
assert_script_run("firewall-cmd --list-services |grep -E 'http[[:space:]]https'", fail_message => 'The firewall ports are not opened');
assert_script_run("grep rmt /etc/rmt.conf", fail_message => 'Missing values in /etc/rmt.conf');
assert_script_run("wget --no-check-certificate https://localhost/rmt.crt", fail_message => 'Certificate not found at https://localhost/rmt.crt');
# yast2-rmt was changed to no longer include the host name as part of the CA
Expand Down
2 changes: 1 addition & 1 deletion tests/ha/check_after_reboot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sub run {
assert_script_run 'journalctl -b --no-pager -o short-precise > bsc1129385-check-journal.log';
my $iscsi_fails = script_run 'grep -q "iscsid: cannot make a connection to" bsc1129385-check-journal.log';
my $csync_fails = script_run 'grep -q "corosync.service: Failed" bsc1129385-check-journal.log';
my $pcmk_fails = script_run 'egrep -q "pacemaker.service.+failed" bsc1129385-check-journal.log';
my $pcmk_fails = script_run 'grep -E -q "pacemaker.service.+failed" bsc1129385-check-journal.log';

if (defined $iscsi_fails and $iscsi_fails == 0 and defined $csync_fails
and $csync_fails == 0 and defined $pcmk_fails and $pcmk_fails == 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/ha/check_logs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sub run {

# Looking for segfault during the test
if (script_run '(( $(grep -sR segfault /var/log | wc -l) == 0 ))') {
if (script_run '(( $(egrep -sR iscsiadm.+segfault /var/log | wc -l) == 0 ))') {
if (script_run '(( $(grep -E -sR iscsiadm.+segfault /var/log | wc -l) == 0 ))') {
record_soft_failure "bsc#1181052 - segfault on iscsiadm";
}
else {
Expand Down
4 changes: 2 additions & 2 deletions tests/installation/validation/ibft.pm
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ sub run {
# find iscsi drive
my $iscsi_drive = script_output 'lsblk --scsi | grep -i iscsi | awk \'NR==1 {print $1}\'';
die "No iSCSI drive found!\n" unless ($iscsi_drive);
assert_script_run 'ls -l /dev/disk/by-path | egrep -e ' . $iscsi_drive . ' -e ' . $ibft_expected->{target}->{ip_addr} .
assert_script_run 'ls -l /dev/disk/by-path | grep -E -e ' . $iscsi_drive . ' -e ' . $ibft_expected->{target}->{ip_addr} .
' -e ' . $ibft_expected->{target}->{target_name};
assert_script_run 'lsblk -o KNAME,MOUNTPOINT,SIZE,RO,TYPE,VENDOR,TRAN,MODE,HCTL,STATE,MAJ:MIN | grep ' . $iscsi_drive;
assert_script_run 'lsscsi -cl | egrep -e state=running -ie ' . $ibft_expected->{backstore}->{vendor} . ' -ie ' . $ibft_expected->{backstore}->{model};
assert_script_run 'lsscsi -cl | grep -E -e state=running -ie ' . $ibft_expected->{backstore}->{vendor} . ' -ie ' . $ibft_expected->{backstore}->{model};
assert_script_run 'iscsiadm -m session -P 1|grep -e ' . $ibft_expected->{target}->{target_name} . ' -e ' . $ibft_expected->{target}->{ip_addr} .
':' . $ibft_expected->{target}->{port} . ' -e ' . $ibft_expected->{initiator}->{initiator_name} . ' -e ' . $ibft_expected->{ethernet}->{ip_addr};

Expand Down
Loading

0 comments on commit 45953f7

Please sign in to comment.