From: Guillaume Abrioux Date: Thu, 13 Jan 2022 21:46:03 +0000 (+0100) Subject: qa/nvme_loop: fix an issue on ubuntu 18.04 X-Git-Tag: v16.2.8~252^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0cbc1e217646d25c1d218b1efda5a398ced1bbc0;p=ceph.git qa/nvme_loop: fix an issue on ubuntu 18.04 The following command: ``` echo /dev/sda | tee /sys/kernel/config/nvmet/subsystems/sda/namespaces/1/device_path ``` makes nvme_loop fail because fascinatingly, it adds an unexpected newline. See: ``` /dev/sda /dev/sda 1 tee: /sys/kernel/config/nvmet/subsystems/sda/namespaces/1/enable: No such file or directory /dev/sda 1 ``` Other distros don't have the same behavior: ``` CentOS 8 /dev/sda /dev/sda 1 Ubuntu 20.04 /dev/sda /dev/sda 1 ``` Signed-off-by: Guillaume Abrioux (cherry picked from commit f8e22fb3da9bfbdc75d88beb66543716afb19511) --- diff --git a/qa/tasks/nvme_loop.py b/qa/tasks/nvme_loop.py index c4a027633343..1501ad636c8f 100644 --- a/qa/tasks/nvme_loop.py +++ b/qa/tasks/nvme_loop.py @@ -45,7 +45,7 @@ def task(ctx, config): run.Raw('&&'), 'sudo', 'mkdir', '-p', f'{base}/subsystems/{short}/namespaces/1', run.Raw('&&'), - 'echo', dev, run.Raw('|'), + 'echo', '-n', dev, run.Raw('|'), 'sudo', 'tee', f'{base}/subsystems/{short}/namespaces/1/device_path', run.Raw('&&'), 'echo', '1', run.Raw('|'),