diff mbox series

[blktests,4/4] nvme/053: provide time extension alternative

Message ID 20241218112153.3917518-5-mcgrof@kernel.org (mailing list archive)
State New
Headers show
Series enable bs > ps device testing | expand

Commit Message

Luis Chamberlain Dec. 18, 2024, 11:21 a.m. UTC
I get this failure when I run this test:

awk: ...rescan.awk:2: warning: The time extension is obsolete.
Use the timex extension from gawkextlib

I can't find this extension either, so just use systime() and
use system(sleep) for the sleep command.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 tests/nvme/053 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/tests/nvme/053 b/tests/nvme/053
index 3ade8d368be6..65a7b86519bc 100755
--- a/tests/nvme/053
+++ b/tests/nvme/053
@@ -27,13 +27,14 @@  rescan_controller() {
 
 create_rescan_script() {
 	cat >"$TMPDIR/rescan.awk" <<EOF
-@load "time"
-
 BEGIN {
     srand(seed);
-    finish = gettimeofday() + strtonum(timeout);
-    while (gettimeofday() < finish) {
-	sleep(0.1 + 5 * rand());
+    start_time = systime();
+    finish = start_time + strtonum(timeout);
+    while (systime() < finish) {
+	sleep_time = 0.1 + 5 * rand();
+        cmd = "sleep " sleep_time;
+        system(cmd);
 	printf("1\n") > path;
 	close(path);
     }