Stefan Berger
2006-Mar-10 14:45 UTC
[Xen-devel] [PATCH] [XMTEST] Test for tpm driver suspend resume cycle
The attached patch adds a test for the suspend/resume cycle of the TPM front- and backend driver pair to the testsuite. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Smith
2006-Mar-10 15:13 UTC
Re: [Xen-devel] [PATCH] [XMTEST] Test for tpm driver suspend resume cycle
SB> status, output = traceCommand("ls /dev/tpm0") SB> if re.search("No such file or directory",output): SB> SKIP("This machine has no hardware TPM; cannot run this test") Why all that when you can just do: os.path.isfile("/dev/tmp0") ?? SB> try: SB> console.sendInput("input") SB> run = console.runCmd("ls /sys") SB> except ConsoleError, e: SB> saveLog(console.getHistory()) SB> vtpm_cleanup(domName) SB> FAIL(str(e)) SB> SB> if re.search("No such file",run["output"]): SB> try: SB> run = console.runCmd("mkdir /sys") SB> run = console.runCmd("mount -t sysfs /sys /sys") SB> except ConsoleError, e: SB> saveLog(console.getHistory()) SB> vtpm_cleanup(domName) SB> FAIL(str(e)) SB> IIRC, /sys will never be mounted inside the ramdisk by default. So the initial check is pointless. Further, I think it would be better to put /sys in the fstab of the ramdisk instead of having every test mount it manually. This makes the tests longer and is something that probably needs to be on by default. I can cook up a quick patch if nobody else volunteers to do it ;) Thanks Stefan! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2006-Mar-10 15:58 UTC
Re: [Xen-devel] [PATCH] [XMTEST] Test for tpm driver suspend resume cycle
xen-devel-bounces@lists.xensource.com wrote on 03/10/2006 10:13:44 AM:> SB> status, output = traceCommand("ls /dev/tpm0") > SB> if re.search("No such file or directory",output): > SB> SKIP("This machine has no hardware TPM; cannot run this test") > > Why all that when you can just do: > > os.path.isfile("/dev/tmp0") > > ??I will fix it.> > SB> try: > SB> console.sendInput("input") > SB> run = console.runCmd("ls /sys") > SB> except ConsoleError, e: > SB> saveLog(console.getHistory()) > SB> vtpm_cleanup(domName) > SB> FAIL(str(e)) > SB> > SB> if re.search("No such file",run["output"]): > SB> try: > SB> run = console.runCmd("mkdir /sys") > SB> run = console.runCmd("mount -t sysfs /sys /sys") > SB> except ConsoleError, e: > SB> saveLog(console.getHistory()) > SB> vtpm_cleanup(domName) > SB> FAIL(str(e)) > SB> > > IIRC, /sys will never be mounted inside the ramdisk by default. So > the initial check is pointless. Further, I think it would be better > to put /sys in the fstab of the ramdisk instead of having every test > mount it manually. This makes the tests longer and is something that > probably needs to be on by default. I can cook up a quick patch if > nobody else volunteers to do it ;)I will remove the check for ''/sys'', but would prefer if you provided the patch for the fstab. Are you going to provide a ''/sys'' mountpoint in the ramdisk as well or should I just keep the ''mkdir /sys''?> > Thanks Stefan!Welcome :-) Stefan> > -- > Dan Smith > IBM Linux Technology Center > Open Hypervisor Team > email: danms@us.ibm.com > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Smith
2006-Mar-10 16:02 UTC
Re: [Xen-devel] [PATCH] [XMTEST] Test for tpm driver suspend resume cycle
SB> I will remove the check for ''/sys'', but would prefer if you SB> provided the patch for the fstab. Are you going to provide a SB> ''/sys'' mountpoint in the ramdisk as well or should I just keep the SB> ''mkdir /sys''? Yea, since /sys will be mounted at boot, the mount point will need to be there ahead of time. Once it''s integrated, I think it''s a safe for tests to assume it''s there, just like they assume /proc is there. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel