Skip to contentSkip to conversation

KVM test: disable password prompt on resume for Windows guests

PATCH In review Michael Goldish 2 participants 7 messages Nov 4, 2009 – Nov 10, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 KVM test: disable password prompt on resume for Windows guests

Add a command to setuprss.bat that disables the password prompt on resuming from hibernation.
Note that for this change to take effect the local winutils.iso should be updated as well.

---
 client/tests/kvm/deps/setuprss.bat |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
client/tests/kvm/deps/setuprss.bat +1 -0
index 7b6618b..82d620d 100644
@@ -5,6 +5,7 @@ copy %rsspath% C:\rss.exe
 net user Administrator /active:yes
 net user Administrator 1q2w3eP
 netsh firewall set opmode disable
+powercfg /G OFF /OPTION RESUMEPASSWORD
 
 reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe 22" /t REG_SZ /f
 reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
Signature · 1 line
1.5.4.1
#1 lore raw

PATCH 2/6 KVM test: fix 2 barriers in WinXP-32.steps

Don't select the "start" word, which is usually rendered with antialiased characters, but is sometimes aliased for some reason. I'm not sure if this is just weird Windows behavior or some sort of qemu/KVM bug.

---
 client/tests/kvm/steps/WinXP-32.steps |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
client/tests/kvm/steps/WinXP-32.steps +2 -2
index f52fd0e..dfac418 100644
@@ -156,14 +156,14 @@ step 2279.61
 screendump 20090416_150641_b72ad5c48ec2dbc9814d569e38cbb4cc.ppm
 # Win XP Start Menu (closed)
 sleep 20
-barrier_2 104 41 0 559 a7cc02cecff2cb495f300aefbb99d9ae 5 optional
+barrier_2 35 41 83 559 7a10415169663ceb4c1bbad9c966810d 5 optional
 # Sending keys: ctrl-esc
 key ctrl-esc
 # --------------------------------
 step 2279.61
 screendump 20080101_000024_51acae003d73d0f4a4c58fa0a053b471.ppm
 # Win XP Start Menu (open)
-barrier_2 189 67 0 533 69a5571c58bdf9e0acee8337883bec43 20
+barrier_2 244 39 90 511 e8634eb8712f6d0b4ca4a65289c1ac01 20
 # Sending keys: u
 key u
 # --------------------------------
Signature · 1 line
1.5.4.1
#2 lore raw

PATCH 3/6 KVM test: migration: rely on background process instead of timing

1. Run a process in the background and make sure it keeps running after migration (similarly to guest_s4).
2. When logging in after migration allow the procedure to take up to 30s instead of only 10s. We can afford this because if the guest reboots during those 30s the background process will not keep running.

---
 client/tests/kvm/kvm_tests.cfg.sample              |    6 ++
 client/tests/kvm/tests/migration.py                |   84 +++++++++++++------
 client/tests/kvm/tests/timedrift_with_migration.py |    2 +-
 3 files changed, 64 insertions(+), 28 deletions(-)
client/tests/kvm/kvm_tests.cfg.sample +6 -0
index 573206c..bcc31bb 100644
@@ -77,6 +77,9 @@ variants:
     - migrate:      install setup
         type = migration
         migration_test_command = help
+        migration_bg_command = "cd /tmp; nohup tcpdump -q -t ip host localhost"
+        migration_bg_check_command = pgrep tcpdump
+        migration_bg_kill_command = pkill tcpdump
         kill_vm_on_error = yes
         iterations = 2
         used_mem = 1024
@@ -499,6 +502,9 @@ variants:
 
         migrate:
             migration_test_command = ver && vol
+            migration_bg_command = start ping -t localhost
+            migration_bg_check_command = tasklist | find /I "ping.exe"
+            migration_bg_kill_command = taskkill /IM ping.exe /F
         stress_boot:
             alive_test_cmd = systeminfo
         timedrift:
client/tests/kvm/tests/migration.py +57 -27

94 lines not on this page · raw message

client/tests/kvm/tests/timedrift_with_migration.py +1 -1
index af02f97..99d645a 100644
@@ -49,7 +49,7 @@ def run_timedrift_with_migration(test, params, env):
             vm = kvm_test_utils.migrate(vm, env)
             # Log in
             logging.info("Logging in after migration...")
-            session = vm.remote_login()
+            session = kvm_utils.wait_for(vm.remote_login, 30, 0, 2)
             if not session:
                 raise error.TestFail("Could not log in after migration")
             logging.info("Logged in after migration")
Signature · 1 line
1.5.4.1
#3 lore raw

PATCH 4/6 KVM test: fix WinVista setup step files

Use the file browser to run setuprss.bat as administrator.

---
 client/tests/kvm/steps/WinVista-32-rss.steps |   59 +++++++++++++-------------
 client/tests/kvm/steps/WinVista-64-rss.steps |   59 +++++++++++++-------------
 2 files changed, 58 insertions(+), 60 deletions(-)
client/tests/kvm/steps/WinVista-32-rss.steps +29 -30
index 643f52e..8d0aa4d 100644
@@ -1,22 +1,29 @@
 # Generated by Step Maker
-# Generated on Sun Aug  9 04:19:57 2009
+# Generated on Tue Nov  3 14:17:33 2009
 # uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
 # --------------------------------
-step 71.65
-screendump 20090809_042109_8c9fa395fde6d45736fe5e78ebad061e.ppm
-# reached desktop; open start menu
-barrier_2 78 30 358 234 d864236c59edceb198409f034b61aa0e 358
-# Sending keys: ctrl-esc
-key ctrl-esc
+step 87.91
+screendump 20091103_141901_8a894eeeb57395c0c148677922cfe404.ppm
+# Reached welcome screen
+barrier_2 82 26 336 249 695dc13173329b155e7ec6f7051ec59e 440
+# Sending keys: 0xdc-r
+key 0xdc-r
 # --------------------------------
-step 76.05
-screendump 20090809_042139_c3155a2c89fcd79dc61478af560ed357.ppm
-# run "d:\setuprss"
-barrier_2 50 13 28 545 42dcbd7b221f12845583f08fb6dbbc66 21
-# Sending keys: d shift-0x27 0x2b s e t u p r s s
+step 92.37
+screendump 20091103_141944_86b166a4d5d978c271b2d27015032738.ppm
+# Open d:\ in a file browser
+barrier_2 36 59 225 428 2ceabcaf10d637b6f6c82309d70972a1 21
+# Sending keys: d shift-0x27 0x2b ret
 key d
 key shift-0x27
 key 0x2b
+key ret
+# --------------------------------
+step 97.15
+screendump 20091103_142130_1136501f2ac6c8a1e8bcabda42b34126.ppm
+# Select setuprss.bat
+barrier_2 86 20 170 468 cf5e40c2969c78d266c3d05aacd628c5 19
+# Sending keys: s e t u p r s s menu
 key s
 key e
 key t
@@ -25,30 +32,22 @@ key p
 key r
 key s
 key s
-# --------------------------------
-step 83.19
-screendump 20090809_042249_46f97eb05a2aabfc918fed642038c03a.ppm
-barrier_2 18 25 14 12 0f48ac3d9a2c1d88d0519721129ce8bf 23
-# Sending keys: down menu
-key down
 key menu
 # --------------------------------
-step 88.52
-screendump 20090809_042324_0eac577fff261097eb35e8a3e41b11ba.ppm
-# run as administrator
-barrier_2 21 58 128 138 9d6d14c39767166f2dd54b644b4430a3 24
+step 103.84
+screendump 20091103_142159_45c9e2fe113811477bba4408c6abb96e.ppm
+# Run as administrator
+sleep 15
 # Sending keys: a
 key a
 # --------------------------------
-step 93.15
-screendump 20090809_042342_0abaf4bb1d04389c5b4548dc031989ca.ppm
-# continue
-barrier_2 20 44 248 239 522013a7f99ea1a1dfbb4a4d5c61dd2a 90
+step 108.32
+screendump 20091103_142215_419d87101ea2204c7eb2f7a997b4792a.ppm
+# Continue
+barrier_2 31 42 462 316 52bc2803827bd4b931bc44a693f81763 90
 # Sending keys: alt-c
 key alt-c
 # --------------------------------
-step 102.84
-screendump 20090809_042403_e287c85ba9d66dd09412917bfc1fecb5.ppm
-# make sure we're done
+step 116.77
+screendump 20091103_142350_c002f223bec9032582be98c095440550.ppm
 sleep 20
-barrier_2 87 25 353 387 4335934bbb63865c37aa2aa6c2376440 90
client/tests/kvm/steps/WinVista-64-rss.steps +29 -30

81 lines not on this page · raw message

Signature · 1 line
1.5.4.1
#4 lore raw

PATCH 5/6 KVM test: kvm_subprocess.py: avoid double-closing file descriptors

Also, properly handle closed file descriptors in read_until_output_matches().

---
 client/tests/kvm/kvm_subprocess.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
client/tests/kvm/kvm_subprocess.py +8 -3
index 859aa2b..9222d33 100755
@@ -497,6 +497,7 @@ class kvm_spawn:
                 os.close(fd)
             except:
                 pass
+        self.reader_fds = {}
         # Remove all used files
         for filename in (_get_filenames("/tmp/kvm_spawn", self.id) +
                          self.reader_filenames.values()):
@@ -861,9 +862,13 @@ class kvm_expect(kvm_tail):
         fd = self._get_fd("expect")
         end_time = time.time() + timeout
         while True:
-            r, w, x = select.select([fd], [], [],
-                                    max(0, end_time - time.time()))
-            if fd not in r: break
+            try:
+                r, w, x = select.select([fd], [], [],
+                                        max(0, end_time - time.time()))
+            except (select.error, TypeError):
+                break
+            if fd not in r:
+                break
             # Read data from child
             newdata = self.read_nonblocking(internal_timeout)
             # Print it if necessary
Signature · 1 line
1.5.4.1
#5 lore raw

PATCH 6/6 KVM test: add -o PreferredAuthentications=password to SSH options

This speeds up SSH logins because by default other time consuming authentication methods are attempted first.

---
 client/tests/kvm/kvm_utils.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
client/tests/kvm/kvm_utils.py +6 -3
index b9219f6..bf25900 100644
@@ -551,7 +551,8 @@ def scp_to_remote(host, port, username, password, local_path, remote_path,
 
     @return: True on success and False on failure.
     """
-    command = ("scp -o UserKnownHostsFile=/dev/null -r -P %s %s %s@%s:%s" %
+    command = ("scp -o UserKnownHostsFile=/dev/null "
+               "-o PreferredAuthentications=password -r -P %s %s %s@%s:%s" %
                (port, local_path, username, host, remote_path))
     return remote_scp(command, password, timeout)
 
@@ -571,7 +572,8 @@ def scp_from_remote(host, port, username, password, remote_path, local_path,
 
     @return: True on success and False on failure.
     """
-    command = ("scp -o UserKnownHostsFile=/dev/null -r -P %s %s@%s:%s %s" %
+    command = ("scp -o UserKnownHostsFile=/dev/null "
+               "-o PreferredAuthentications=password -r -P %s %s@%s:%s %s" %
                (port, username, host, remote_path, local_path))
     return remote_scp(command, password, timeout)
 
@@ -589,7 +591,8 @@ def ssh(host, port, username, password, prompt, linesep="\n", timeout=10):
 
     @return: kvm_spawn object on success and None on failure.
     """
-    command = ("ssh -o UserKnownHostsFile=/dev/null -p %s %s@%s" %
+    command = ("ssh -o UserKnownHostsFile=/dev/null "
+               "-o PreferredAuthentications=password -p %s %s@%s" %
                (port, username, host))
     return remote_login(command, password, prompt, linesep, timeout)
 
Signature · 1 line
1.5.4.1
#6 lore raw
In reply to Michael Goldish

Patchset applied, thanks!

Quoted 30 lines · Michael Goldish

Add a command to setuprss.bat that disables the password prompt on resuming from hibernation.
Note that for this change to take effect the local winutils.iso should be updated as well.

---
 client/tests/kvm/deps/setuprss.bat |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
client/tests/kvm/deps/setuprss.bat +0 -0
index 7b6618b..82d620d 100644
@@ -5,6 +5,7 @@ copy %rsspath% C:\rss.exe

 net user Administrator /active:yes
 net user Administrator 1q2w3eP
 netsh firewall set opmode disable
+powercfg /G OFF /OPTION RESUMEPASSWORD

 reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe 22" /t REG_SZ /f reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f --
1.5.4.1

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Signature · 1 line
Lucas