ia64/xen-unstable

changeset 8153:bd250c4a86cb

Some tweaks to the restore and migrate tests to expose the consoles of the
restored DomUs, since they currently Oops on x86_64.
author dan@guaranine.beaverton.ibm.com
date Wed Nov 30 11:44:19 2005 +0000 (2005-11-30)
parents 989896f3bc45
children 6bc8ceab6dff
files tools/xm-test/tests/migrate/01_migrate_localhost_pos.py tools/xm-test/tests/restore/01_restore_basic_pos.py tools/xm-test/tests/restore/04_restore_withdevices_pos.py
line diff
     1.1 --- a/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py	Wed Nov 30 11:42:07 2005 +0000
     1.2 +++ b/tools/xm-test/tests/migrate/01_migrate_localhost_pos.py	Wed Nov 30 11:44:19 2005 +0000
     1.3 @@ -38,8 +38,8 @@ except ConsoleError, e:
     1.4  try:
     1.5      # Activate the console
     1.6      console.sendInput("foo")
     1.7 -    # Make sure a command succeeds
     1.8 -    run = console.runCmd("ls /bin")
     1.9 +    # Set a variable to check on the other side
    1.10 +    run = console.runCmd("foo=bar")
    1.11  except ConsoleError, e:
    1.12      FAIL(str(e))
    1.13  
    1.14 @@ -66,18 +66,21 @@ if (old_domid == new_domid):
    1.15  # Attach a console to it
    1.16  try:
    1.17      console = XmConsole(domain.getName(), historySaveCmds=True)
    1.18 +    console.debugMe = True
    1.19  except ConsoleError, e:
    1.20      pass
    1.21  
    1.22 +console.sendInput("ls")
    1.23 +
    1.24  # Run 'ls'
    1.25  try:
    1.26      # Check the dmesg output on the domU
    1.27 -    run = console.runCmd("ls /bin")
    1.28 +    run = console.runCmd("echo xx$foo")
    1.29  except ConsoleError, e:
    1.30      FAIL(str(e))
    1.31 -
    1.32 -if not re.search("chmod", run["output"]):
    1.33 -    FAIL("invalid console output from ls after migration")
    1.34 +    
    1.35 +if not re.search("bar", run["output"]):
    1.36 +    FAIL("Migrated domain has been reset")
    1.37  
    1.38  # Close the console
    1.39  console.closeConsole()
     2.1 --- a/tools/xm-test/tests/restore/01_restore_basic_pos.py	Wed Nov 30 11:42:07 2005 +0000
     2.2 +++ b/tools/xm-test/tests/restore/01_restore_basic_pos.py	Wed Nov 30 11:44:19 2005 +0000
     2.3 @@ -25,6 +25,8 @@ except DomainError, e:
     2.4  # Make sure the domain isn't DOA
     2.5  try:
     2.6      console = XmConsole(domain.getName())
     2.7 +    console.sendInput("input")
     2.8 +    console.runCmd("foo=bar")
     2.9  except ConsoleError, e:
    2.10      FAIL(str(e))
    2.11  
    2.12 @@ -63,9 +65,12 @@ if not isDomainRunning(domain.getName())
    2.13  # Make sure it's alive
    2.14  try:
    2.15      newConsole = XmConsole(domain.getName())
    2.16 -    run = newConsole.runCmd("ls")
    2.17 -    if run["return"] != 0:
    2.18 -        FAIL("Unable to read from restored domain")
    2.19 +    # Enable debug dumping because this generates a Oops on x86_64
    2.20 +    newConsole.debugMe = True
    2.21 +    newConsole.sendInput("ls")
    2.22 +    run = newConsole.runCmd("echo xx$foo")
    2.23 +    if not re.search("bar", run["output"]):
    2.24 +        FAIL("Restored domain has been reset")
    2.25  except ConsoleError, e:
    2.26      FAIL("Restored domain is dead (%s)" % str(e))
    2.27  
     3.1 --- a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py	Wed Nov 30 11:42:07 2005 +0000
     3.2 +++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py	Wed Nov 30 11:44:19 2005 +0000
     3.3 @@ -90,6 +90,11 @@ if s != 0:
     3.4  
     3.5  try:
     3.6      console = XmConsole(domain.getName())
     3.7 +    # Enable debug dumping, as this causes an Oops on x86_64
     3.8 +    console.debugMe = True
     3.9 +
    3.10 +    # In case the domain is rebooted
    3.11 +    console.sendInput("ls")
    3.12  
    3.13      run = console.runCmd("ls | grep proc")
    3.14      if run["return"] != 0: