Skip to content

Commit b16e0a5

Browse files
committed
Add test for missing service arguments
The test currently fails due to QubesOS/qubes-issues#9090. The test for socket services will be added along with the fix, as without the fix it hangs.
1 parent c0e7f6a commit b16e0a5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

qrexec/tests/socket/agent.py

+33
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import struct
2727
import getpass
2828
import itertools
29+
import asyncio
2930

3031
import psutil
3132
import pytest
@@ -584,6 +585,38 @@ def test_exec_broken_specific_service(self):
584585
)
585586
self.check_dom0(dom0)
586587

588+
@unittest.expectedFailure
589+
def test_exec_null_argument_finds_service_for_empty_argument(self):
590+
self.make_executable_service(
591+
"local-rpc",
592+
"qubes.Service+",
593+
"""\
594+
#!/bin/sh --
595+
echo "specific service: $QREXEC_SERVICE_FULL_NAME"
596+
""",
597+
)
598+
self.make_executable_service(
599+
"rpc",
600+
"qubes.Service",
601+
"""\
602+
#!/bin/sh
603+
echo "general service"
604+
""",
605+
)
606+
target, dom0 = self.execute_qubesrpc("qubes.Service", "domX")
607+
target.send_message(qrexec.MSG_DATA_STDIN, b"")
608+
messages = target.recv_all_messages()
609+
self.assertListEqual(
610+
util.sort_messages(messages),
611+
[
612+
(qrexec.MSG_DATA_STDOUT, b"specific service: qubes.Service\n"),
613+
(qrexec.MSG_DATA_STDOUT, b""),
614+
(qrexec.MSG_DATA_STDERR, b""),
615+
(qrexec.MSG_DATA_EXIT_CODE, b"\0\0\0\0"),
616+
],
617+
)
618+
self.check_dom0(dom0)
619+
587620
def test_connect_socket_no_metadata(self):
588621
socket_path = os.path.join(
589622
self.tempdir, "rpc", "qubes.SocketService+arg2"

0 commit comments

Comments
 (0)