Skip to content

Commit 96e818a

Browse files
committed
Use newer disposable token
Itches that it is different.
1 parent 963532c commit 96e818a

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

qubesadmin/tests/tools/qvm_run.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -668,15 +668,15 @@ def test_008_dispvm_remote(self):
668668
self.app.service_calls,
669669
[
670670
(
671-
"$dispvm",
671+
"@dispvm",
672672
"test.service",
673673
{
674674
"stdout": subprocess.DEVNULL,
675675
"stderr": subprocess.DEVNULL,
676676
"user": None,
677677
},
678678
),
679-
("$dispvm", "test.service", b""),
679+
("@dispvm", "test.service", b""),
680680
],
681681
)
682682
self.assertAllCalled()
@@ -699,15 +699,15 @@ def test_009_dispvm_remote_specific(self):
699699
self.app.service_calls,
700700
[
701701
(
702-
"$dispvm:test-vm",
702+
"@dispvm:test-vm",
703703
"test.service",
704704
{
705705
"stdout": subprocess.DEVNULL,
706706
"stderr": subprocess.DEVNULL,
707707
"user": None,
708708
},
709709
),
710-
("$dispvm:test-vm", "test.service", b""),
710+
("@dispvm:test-vm", "test.service", b""),
711711
],
712712
)
713713
self.assertAllCalled()
@@ -1150,7 +1150,7 @@ def test_022_no_shell(self):
11501150
def test_023_dispvm_no_shell(self):
11511151
self.app.expected_calls[
11521152
(
1153-
"$dispvm:test-vm",
1153+
"@dispvm:test-vm",
11541154
"admin.vm.feature.CheckWithTemplate",
11551155
"vmexec",
11561156
None,
@@ -1165,15 +1165,15 @@ def test_023_dispvm_no_shell(self):
11651165
self.app.service_calls,
11661166
[
11671167
(
1168-
"$dispvm:test-vm",
1168+
"@dispvm:test-vm",
11691169
"qubes.VMExec+command",
11701170
{
11711171
"stdout": subprocess.DEVNULL,
11721172
"stderr": subprocess.DEVNULL,
11731173
"user": None,
11741174
},
11751175
),
1176-
("$dispvm:test-vm", "qubes.VMExec+command", b""),
1176+
("@dispvm:test-vm", "qubes.VMExec+command", b""),
11771177
],
11781178
)
11791179
self.assertAllCalled()
@@ -1277,7 +1277,7 @@ def test_026_no_shell_double_dashdash(self):
12771277
def test_027_no_shell_dispvm(self):
12781278
self.app.expected_calls[
12791279
(
1280-
"$dispvm:test-vm",
1280+
"@dispvm:test-vm",
12811281
"admin.vm.feature.CheckWithTemplate",
12821282
"vmexec",
12831283
None,
@@ -1292,23 +1292,23 @@ def test_027_no_shell_dispvm(self):
12921292
self.app.service_calls,
12931293
[
12941294
(
1295-
"$dispvm:test-vm",
1295+
"@dispvm:test-vm",
12961296
"qubes.VMExec+command+arg",
12971297
{
12981298
"stdout": subprocess.DEVNULL,
12991299
"stderr": subprocess.DEVNULL,
13001300
"user": None,
13011301
},
13021302
),
1303-
("$dispvm:test-vm", "qubes.VMExec+command+arg", b""),
1303+
("@dispvm:test-vm", "qubes.VMExec+command+arg", b""),
13041304
],
13051305
)
13061306
self.assertAllCalled()
13071307

13081308
def test_028_argparse_bug_workaround(self):
13091309
self.app.expected_calls[
13101310
(
1311-
"$dispvm:test-vm",
1311+
"@dispvm:test-vm",
13121312
"admin.vm.feature.CheckWithTemplate",
13131313
"vmexec",
13141314
None,
@@ -1323,23 +1323,23 @@ def test_028_argparse_bug_workaround(self):
13231323
self.app.service_calls,
13241324
[
13251325
(
1326-
"$dispvm:test-vm",
1326+
"@dispvm:test-vm",
13271327
"qubes.VMExec+command+----",
13281328
{
13291329
"stdout": subprocess.DEVNULL,
13301330
"stderr": subprocess.DEVNULL,
13311331
"user": None,
13321332
},
13331333
),
1334-
("$dispvm:test-vm", "qubes.VMExec+command+----", b""),
1334+
("@dispvm:test-vm", "qubes.VMExec+command+----", b""),
13351335
],
13361336
)
13371337
self.assertAllCalled()
13381338

13391339
def test_029_command_is_dashdash(self):
13401340
self.app.expected_calls[
13411341
(
1342-
"$dispvm:test-vm",
1342+
"@dispvm:test-vm",
13431343
"admin.vm.feature.CheckWithTemplate",
13441344
"vmexec",
13451345
None,
@@ -1354,22 +1354,22 @@ def test_029_command_is_dashdash(self):
13541354
self.app.service_calls,
13551355
[
13561356
(
1357-
"$dispvm:test-vm",
1357+
"@dispvm:test-vm",
13581358
"qubes.VMExec+----",
13591359
{
13601360
"stdout": subprocess.DEVNULL,
13611361
"stderr": subprocess.DEVNULL,
13621362
"user": None,
13631363
},
13641364
),
1365-
("$dispvm:test-vm", "qubes.VMExec+----", b""),
1365+
("@dispvm:test-vm", "qubes.VMExec+----", b""),
13661366
],
13671367
)
13681368
self.assertAllCalled()
13691369

13701370
def test_030_no_shell_dispvm(self):
13711371
self.app.expected_calls[
1372-
("$dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
1372+
("@dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
13731373
] = b"0\x001"
13741374
ret = qubesadmin.tools.qvm_run.main(
13751375
["--no-gui", "--dispvm", "--", "test-vm", "command", "arg"],
@@ -1380,22 +1380,22 @@ def test_030_no_shell_dispvm(self):
13801380
self.app.service_calls,
13811381
[
13821382
(
1383-
"$dispvm",
1383+
"@dispvm",
13841384
"qubes.VMExec+test--vm+command+arg",
13851385
{
13861386
"stdout": subprocess.DEVNULL,
13871387
"stderr": subprocess.DEVNULL,
13881388
"user": None,
13891389
},
13901390
),
1391-
("$dispvm", "qubes.VMExec+test--vm+command+arg", b""),
1391+
("@dispvm", "qubes.VMExec+test--vm+command+arg", b""),
13921392
],
13931393
)
13941394
self.assertAllCalled()
13951395

13961396
def test_031_argparse_bug_workaround(self):
13971397
self.app.expected_calls[
1398-
("$dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
1398+
("@dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
13991399
] = b"0\x001"
14001400
ret = qubesadmin.tools.qvm_run.main(
14011401
["--no-gui", "--dispvm", "--", "test-vm", "command", "--"],
@@ -1406,23 +1406,23 @@ def test_031_argparse_bug_workaround(self):
14061406
self.app.service_calls,
14071407
[
14081408
(
1409-
"$dispvm",
1409+
"@dispvm",
14101410
"qubes.VMExec+test--vm+command+----",
14111411
{
14121412
"stdout": subprocess.DEVNULL,
14131413
"stderr": subprocess.DEVNULL,
14141414
"user": None,
14151415
},
14161416
),
1417-
("$dispvm", "qubes.VMExec+test--vm+command+----", b""),
1417+
("@dispvm", "qubes.VMExec+test--vm+command+----", b""),
14181418
],
14191419
)
14201420
self.assertAllCalled()
14211421

14221422
@unittest.expectedFailure
14231423
def test_032_argparse_bug_workaround_unnamed_dispvm(self):
14241424
self.app.expected_calls[
1425-
("$dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
1425+
("@dispvm", "admin.vm.feature.CheckWithTemplate", "vmexec", None)
14261426
] = b"0\x001"
14271427
ret = qubesadmin.tools.qvm_run.main(
14281428
["--no-gui", "--dispvm", "test-vm", "command", "--"], app=self.app
@@ -1432,15 +1432,15 @@ def test_032_argparse_bug_workaround_unnamed_dispvm(self):
14321432
self.app.service_calls,
14331433
[
14341434
(
1435-
"$dispvm",
1435+
"@dispvm",
14361436
"qubes.VMExec+test--vm+command+----",
14371437
{
14381438
"stdout": subprocess.DEVNULL,
14391439
"stderr": subprocess.DEVNULL,
14401440
"user": None,
14411441
},
14421442
),
1443-
("$dispvm", "qubes.VMExec+test--vm+command+----", b""),
1443+
("@dispvm", "qubes.VMExec+test--vm+command+----", b""),
14441444
],
14451445
)
14461446
self.assertAllCalled()

qubesadmin/tests/vm/dispvm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def test_010_remote_create_default(self):
7373
vm.run_service_for_stdio('test.service')
7474
vm.cleanup()
7575
self.assertEqual(self.app.service_calls, [
76-
('$dispvm', 'test.service', {}),
77-
('$dispvm', 'test.service', b''),
76+
('@dispvm', 'test.service', {}),
77+
('@dispvm', 'test.service', b''),
7878
])
7979
self.assertAllCalled()
8080

@@ -83,8 +83,8 @@ def test_011_remote_create_specific(self):
8383
vm.run_service_for_stdio('test.service')
8484
vm.cleanup()
8585
self.assertEqual(self.app.service_calls, [
86-
('$dispvm:test-vm', 'test.service', {}),
87-
('$dispvm:test-vm', 'test.service', b''),
86+
('@dispvm:test-vm', 'test.service', {}),
87+
('@dispvm:test-vm', 'test.service', b''),
8888
])
8989
self.assertAllCalled()
9090

qubesadmin/vm/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def run_service(self, service, **kwargs):
465465
"""Create disposable if absent and run service."""
466466
if (
467467
self.app.qubesd_connection_type == "socket"
468-
and self._method_dest.startswith("$dispvm")
468+
and self._method_dest.startswith("@dispvm")
469469
):
470470
self.create_disposable()
471471
# Service call may wait for session start, give it more time
@@ -481,7 +481,7 @@ def cleanup(self):
481481
"""
482482
if (
483483
self.app.qubesd_connection_type == "socket"
484-
and not self._method_dest.startswith("$dispvm")
484+
and not self._method_dest.startswith("@dispvm")
485485
):
486486
try:
487487
self.kill()
@@ -490,15 +490,15 @@ def cleanup(self):
490490

491491
def start(self):
492492
"""Create disposable if absent and start it."""
493-
if self._method_dest.startswith("$dispvm"):
493+
if self._method_dest.startswith("@dispvm"):
494494
self.create_disposable()
495495
super().start()
496496

497497
def create_disposable(self):
498498
"""Create disposable."""
499-
if self._method_dest.startswith("$dispvm"):
500-
if self._method_dest.startswith("$dispvm:"):
501-
method_dest = self._method_dest[len("$dispvm:") :]
499+
if self._method_dest.startswith("@dispvm"):
500+
if self._method_dest.startswith("@dispvm:"):
501+
method_dest = self._method_dest[len("@dispvm:") :]
502502
else:
503503
method_dest = "dom0"
504504
dispvm = self.app.qubesd_call(
@@ -518,9 +518,9 @@ def from_appvm(cls, app, appvm):
518518
AppVM. If *appvm* is none, use default DispVM template"""
519519

520520
if appvm:
521-
method_dest = "$dispvm:" + str(appvm)
521+
method_dest = "@dispvm:" + str(appvm)
522522
else:
523-
method_dest = "$dispvm"
523+
method_dest = "@dispvm"
524524

525525
wrapper = DispVMWrapper(app, method_dest)
526526
return wrapper

0 commit comments

Comments
 (0)