From: Dan Smith Subject: Re: [PATCH] [XMTEST] Test for tpm driver suspend resume cycle Date: Fri, 10 Mar 2006 07:13:44 -0800 Message-ID: <87irqm2uzb.fsf@caffeine.beaverton.ibm.com> References: <1142001950.7462.12.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <1142001950.7462.12.camel@localhost.localdomain> (Stefan Berger's message of "Fri, 10 Mar 2006 09:45:50 -0500") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefan Berger Cc: xen-devel@lists.xensource.com, Ewan Mellor List-Id: xen-devel@lists.xenproject.org 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