dash which is used as /bin/sh on Ubuntu interprets "2&> /dev/null" as
an instruction to launch iscsiadm in the background. While that is
mostly compensated by the following sleep, stderr isn't redirected to
/dev/null either -- the output gets polluted and the test fails.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
d3f385aaed0b7631f6d69bf1ed88f9570b1d8f50)
Login to the target
===================
$ IP=`cat /etc/ceph/iscsi-gateway.cfg |grep 'trusted_ip_list' | awk -F'[, ]' '{print $3}'`
- > sudo iscsiadm -m discovery -t st -p $IP -l 2&> /dev/null
+ $ sudo iscsiadm -m discovery -t st -p $IP -l >/dev/null 2>&1
$ sleep 10
$ sudo ls /dev/disk/by-path/ |grep 'iscsi-iqn.2003-01.com.redhat.iscsi-gw:ceph-gw' |wc -l
2