faft: Use numeric sort when listing /dev/sd*
The -v option to `ls` will sort numerically:
sda, sda1, sda2, ..., sda9, sda10, sda11
Previously, it would sort alphabetically:
sda, sda1, sda10, sda11, sda2, ..., sda9
BUG=b:158972448, b:158015624
TEST=Run firwmare_FAFTSetup with 'mount -o ro' adjusted to something invalid
Change-Id: I8fc56bc380439df8e1f38128cc37726939344b65
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2274064
Commit-Queue: Dana Goyette <dgoyette@chromium.org>
Tested-by: Dana Goyette <dgoyette@chromium.org>
Reviewed-by: Dossym Nurmukhanov <dossym@chromium.org>
diff --git a/server/cros/faft/telemetry.py b/server/cros/faft/telemetry.py
index 87b3917..2a15284 100644
--- a/server/cros/faft/telemetry.py
+++ b/server/cros/faft/telemetry.py
@@ -23,8 +23,8 @@
collects the DUT-side output of :
- `lsusb` and `lsusb -t` output to learn about the topology;
- - `ls -l /dev/sd*` to learn which storage devices are known to the OS and
- what partition scheme is assumed by the kernel;
+ - `ls -lv /dev/sd*` to learn which storage devices are known to the OS and
+ what partition scheme is assumed by the kernel (-v to sort numerically);
- `fdisk -l` for the partitioning as reported in GPT/MBR
Note that the return value begins with a newline.
@@ -33,7 +33,7 @@
for cmd in [
'lsusb',
'lsusb -t',
- 'ls -l /dev/sd*',
+ 'ls -lv /dev/sd*',
'fdisk -l'
]:
output = servo.system_output(cmd, ignore_status=True)