]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/nvme_loop: fix an issue on ubuntu 18.04
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 13 Jan 2022 21:46:03 +0000 (22:46 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 17 Jan 2022 16:10:08 +0000 (17:10 +0100)
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 <gabrioux@redhat.com>
qa/tasks/nvme_loop.py

index c4a027633343cbee68956902524ae87c768d6f52..1501ad636c8f550fb770634e87416d341c1de691 100644 (file)
@@ -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('|'),