Skip to content

Commit

Permalink
tests/integ: add test for per-service user override
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Sep 19, 2023
1 parent 146beb1 commit 56d422e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qubes/tests/integ/qrexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,18 @@ def test_098_qrexec_service_socket_vm_eof(self):
self.assertEqual(service_stdout, service_descriptor + b'test1test2',
'Received data differs from what was expected')

def test_100_qrexec_service_force_user(self):
self.loop.run_until_complete(self.testvm1.start())

self.create_remote_file(self.testvm1, '/etc/qubes-rpc/test.User',
'#!/bin/sh\n/usr/bin/id -u\n')
self.create_remote_file(self.testvm1, '/etc/qubes/rpc-config/test.User',
'force-user=\'root\'\n')

stdout, stderr = self.loop.run_until_complete(
self.testvm1.run_service_for_stdio('test.User'))
self.assertEqual(stdout.strip(), b'0')


def create_testcases_for_templates():
return qubes.tests.create_testcases_for_templates('TC_00_Qrexec',
Expand Down

0 comments on commit 56d422e

Please sign in to comment.