Skip to content

Commit 7ed4303

Browse files
committed
Test for errors reading a service config file
This fails because of QubesOS/qubes-issues#9100
1 parent ef32e6e commit 7ed4303

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

qrexec/tests/socket/agent.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,12 @@ def exec_service_with_invalid_config(self, invalid_config):
508508
echo "arg: $1, remote domain: $QREXEC_REMOTE_DOMAIN"
509509
""",
510510
)
511-
with open(
512-
os.path.join(self.tempdir, "rpc-config", "qubes.Service+arg"), "w"
513-
) as f:
514-
f.write(invalid_config)
511+
config_path = os.path.join(self.tempdir, "rpc-config", "qubes.Service+arg")
512+
if invalid_config is not None:
513+
with open(config_path, "w") as f:
514+
f.write(invalid_config)
515+
else:
516+
os.symlink("/dev/null/doesnotexist", config_path)
515517
target, dom0 = self.execute_qubesrpc("qubes.Service+arg", "domX")
516518
messages = target.recv_all_messages()
517519
self.assertListEqual(
@@ -539,6 +541,10 @@ def test_exec_service_with_invalid_config_4(self):
539541
def test_exec_service_with_invalid_config_5(self):
540542
self.exec_service_with_invalid_config("wait-for-session\n")
541543

544+
@unittest.expectedFailure
545+
def test_exec_service_with_invalid_config_6(self):
546+
self.exec_service_with_invalid_config(None)
547+
542548
def test_exec_service_with_arg(self):
543549
self.make_executable_service(
544550
"local-rpc",

0 commit comments

Comments
 (0)