[PULL 15/29] iotests: fix check for sudo access in LUKS I/O test

2026-05-21 Thread Daniel P . Berrangé
The test did not cope with the possibility that 'sudo' was not installed
at all, merely that it was not configured. This broke tests in any CI
env which lacks 'sudo'.

Reviewed-by: Kevin Wolf 
Reviewed-by: Thomas Huth 
Reviewed-by: Pierrick Bouvier 
Signed-off-by: Daniel P. Berrangé 
---
 tests/qemu-iotests/149 | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149
index c13343d7ef..6dff39a28a 100755
--- a/tests/qemu-iotests/149
+++ b/tests/qemu-iotests/149
@@ -95,11 +95,14 @@ def verify_passwordless_sudo():
 
 args = ["sudo", "-n", "/bin/true"]
 
-proc = subprocess.Popen(args,
-stdin=subprocess.PIPE,
-stdout=subprocess.PIPE,
-stderr=subprocess.STDOUT,
-universal_newlines=True)
+try:
+proc = subprocess.Popen(args,
+stdin=subprocess.PIPE,
+stdout=subprocess.PIPE,
+stderr=subprocess.STDOUT,
+universal_newlines=True)
+except FileNotFoundError as e:
+iotests.notrun('requires sudo binary: %s' % e)
 
 msg = proc.communicate()[0]
 
-- 
2.54.0




[PULL 15/29] iotests: fix check for sudo access in LUKS I/O test

2026-05-20 Thread Daniel P . Berrangé
The test did not cope with the possibility that 'sudo' was not installed
at all, merely that it was not configured. This broke tests in any CI
env which lacks 'sudo'.

Reviewed-by: Kevin Wolf 
Reviewed-by: Thomas Huth 
Reviewed-by: Pierrick Bouvier 
Signed-off-by: Daniel P. Berrangé 
---
 tests/qemu-iotests/149 | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149
index c13343d7ef..6dff39a28a 100755
--- a/tests/qemu-iotests/149
+++ b/tests/qemu-iotests/149
@@ -95,11 +95,14 @@ def verify_passwordless_sudo():
 
 args = ["sudo", "-n", "/bin/true"]
 
-proc = subprocess.Popen(args,
-stdin=subprocess.PIPE,
-stdout=subprocess.PIPE,
-stderr=subprocess.STDOUT,
-universal_newlines=True)
+try:
+proc = subprocess.Popen(args,
+stdin=subprocess.PIPE,
+stdout=subprocess.PIPE,
+stderr=subprocess.STDOUT,
+universal_newlines=True)
+except FileNotFoundError as e:
+iotests.notrun('requires sudo binary: %s' % e)
 
 msg = proc.communicate()[0]
 
-- 
2.54.0