direct-io.hg

changeset 11471:4bac02935c87

When redirecting the output of the echo command using '>' on bash, the
output seems to be broken up into multiple write()s (depending on the
version of busybox?). Unfortunately /dev/tpm0 needs to have the complete
command written to in one chunk. The work-around 'echo <string> > file ;
cat file > /dev/tpm0' seems to get around this problem.
The patch also removes a redundant test and error output.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Sep 14 07:57:41 2006 +0100 (2006-09-14)
parents 2b8dc69744e3
children 97f3368d1dd3
files tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py tools/xm-test/tests/vtpm/vtpm_utils.py
line diff
     1.1 --- a/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py	Thu Sep 14 07:55:28 2006 +0100
     1.2 +++ b/tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py	Thu Sep 14 07:57:41 2006 +0100
     1.3 @@ -42,7 +42,7 @@ except ConsoleError, e:
     1.4      FAIL("Error while creating /dev/tpm0")
     1.5  
     1.6  try:
     1.7 -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
     1.8 +    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
     1.9  except ConsoleError, e:
    1.10      saveLog(console.getHistory())
    1.11      vtpm_cleanup(domName)
     2.1 --- a/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py	Thu Sep 14 07:55:28 2006 +0100
     2.2 +++ b/tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py	Thu Sep 14 07:57:41 2006 +0100
     2.3 @@ -43,7 +43,7 @@ except ConsoleError, e:
     2.4      FAIL("Error while creating /dev/tpm0")
     2.5  
     2.6  try:
     2.7 -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
     2.8 +    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
     2.9  except ConsoleError, e:
    2.10      saveLog(console.getHistory())
    2.11      vtpm_cleanup(domName)
     3.1 --- a/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py	Thu Sep 14 07:55:28 2006 +0100
     3.2 +++ b/tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py	Thu Sep 14 07:57:41 2006 +0100
     3.3 @@ -43,7 +43,7 @@ except ConsoleError, e:
     3.4      FAIL("Error while creating /dev/tpm0")
     3.5  
     3.6  try:
     3.7 -    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
     3.8 +    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
     3.9  except ConsoleError, e:
    3.10      saveLog(console.getHistory())
    3.11      vtpm_cleanup(domName)
     4.1 --- a/tools/xm-test/tests/vtpm/vtpm_utils.py	Thu Sep 14 07:55:28 2006 +0100
     4.2 +++ b/tools/xm-test/tests/vtpm/vtpm_utils.py	Thu Sep 14 07:57:41 2006 +0100
     4.3 @@ -8,9 +8,6 @@ from XmTestLib import *
     4.4  if ENABLE_HVM_SUPPORT:
     4.5      SKIP("vtpm tests not supported for HVM domains")
     4.6  
     4.7 -if not os.path.exists("/dev/tpm0"):
     4.8 -    SKIP("This machine has no hardware TPM; cannot run this test")
     4.9 -
    4.10  status, output = traceCommand("ps aux | grep vtpm_manager | grep -v grep")
    4.11  if output == "":
    4.12      FAIL("virtual TPM manager must be started to run this test")