@@ -36,6 +36,7 @@ class TestMachinesConsoles(VirtualMachinesCase):
36
36
@skipImage ('spice-server does not exist on RHEL 9' , "rhel-9-1" , "rhel-9-2" , "rhel-9-3" , "centos-9-stream" )
37
37
def testExternalConsole (self ):
38
38
b = self .browser
39
+ m = self .machine
39
40
40
41
self .createVm ("subVmTest1" , graphics = "spice" )
41
42
@@ -46,14 +47,14 @@ class TestMachinesConsoles(VirtualMachinesCase):
46
47
b .wait_in_text ("#vm-subVmTest1-system-state" , "Running" ) # running or paused
47
48
self .goToVmPage ("subVmTest1" )
48
49
49
- # since VNC is not defined for this VM , the view for "Desktop Viewer " is rendered by default
50
- b .wait_in_text (".pf-c-console__manual-connection dl > div:first-child dd" , "127.0.0.1 " )
50
+ # since vnc is not defined for this vm , the view for "desktop viewer " is rendered by default
51
+ b .wait_in_text (".pf-c-console__manual-connection dl > div:first-child dd" , "localhost " )
51
52
b .wait_in_text (".pf-c-console__manual-connection dl > div:nth-child(2) dd" , "5900" )
52
53
53
54
b .click (".pf-c-console__remote-viewer-launch-vv" ) # "Launch Remote Viewer" button
54
55
b .wait_visible ("#dynamically-generated-file" ) # is .vv file generated for download?
55
56
self .assertEqual (b .attr ("#dynamically-generated-file" , "href" ),
56
- u"data:application/x-virt-viewer,%5Bvirt-viewer%5D%0Atype%3Dspice%0Ahost%3D127.0.0.1 %0Aport%3D5900%0Adelete-this-file%3D1%0Afullscreen%3D0%0A" )
57
+ u"data:application/x-virt-viewer,%5Bvirt-viewer%5D%0Atype%3Dspice%0Ahost%3Dlocalhost %0Aport%3D5900%0Adelete-this-file%3D1%0Afullscreen%3D0%0A" )
57
58
58
59
# HACK: clicking 'Launch Remote Viewer' kills execution context and thus CDP fails
59
60
b .reload ()
@@ -69,6 +70,12 @@ class TestMachinesConsoles(VirtualMachinesCase):
69
70
70
71
b .assert_pixels ("#vm-subVmTest1-consoles-page" , "vm-details-console-external" , skip_layouts = ["rtl" ])
71
72
73
+ m .execute ("echo '127.0.0.3 foodomain.org' >> /etc/hosts" )
74
+ m .execute ("virt-xml subVmTest1 --edit --graphics listen='foodomain.org'" )
75
+ m .execute ("virsh destroy subVmTest1; virsh start subVmTest1" )
76
+
77
+ b .wait_in_text (".pf-c-console__manual-connection dl > div:first-child dd" , "foodomain.org" )
78
+
72
79
def testInlineConsole (self , urlroot = "" ):
73
80
b = self .browser
74
81
0 commit comments