Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932642AbdDFRBs (ORCPT ); Thu, 6 Apr 2017 13:01:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47722 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbdDFRBk (ORCPT ); Thu, 6 Apr 2017 13:01:40 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 62F346070F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=timur@codeaurora.org Subject: Re: ktest help To: Steven Rostedt Cc: "John 'Warthog9' Hawley" , LKML References: <20170405215350.0c43734c@grimm.local.home> <20170406124901.0e5efe12@gandalf.local.home> From: Timur Tabi Message-ID: <37da87f8-afb8-70a4-c6e7-b83525210437@codeaurora.org> Date: Thu, 6 Apr 2017 12:01:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <20170406124901.0e5efe12@gandalf.local.home> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2025 Lines: 56 On 04/06/2017 11:49 AM, Steven Rostedt wrote: >> > >> > This tftp's the kernel image (Image.q) and then boots. I'm having >> > difficulty figuring out how to implement that in ktest. >> > > Can you make a script do this? If so, then you can simply tell ktest to > call that script. See the options SWITCH_TO_TEST and SWITCH_TO_GOOD. Not really. Today, I literally copy/paste that command into my putty session every time I boot. I currently have a poor-mans-ktest that I use today, that I'm hoping to replace with ktest itself. It's a Python script that uses pexpect to communicate with a serial-to-ethernet device. It's fragile and ugly, but it generally works: def pxe_boot(child, kernel): global options global args print 'Looking for Grub prompt' count = 24 # two minutes, twice while True: child.sendline('c') try: child.expect('grub> ', timeout = 10) break except pexpect.TIMEOUT as e: count -= 1 if count == 0: print 'Boot failed' return if count == 12: bmc_reboot(options.bmc) print 'Rebooting via BMC' else: print 'Still waiting ...' pass print 'Loading kernel %s' % sys.argv[1] if options.amberwing: child.sendline('linux %s earlycon=pl011,0xff78ed1000 console=ttyAMA1 rootwait rw ip=dhcp root=/dev/sda2 rootfstype=ext4 panic=1' % args[0]) else: child.sendline('linux %s earlycon=pl011,mmio32,0x3ced1000 console=ttyAMA0 rootwait rw ip=dhcp root=/dev/sda2 rootfstype=ext4 panic=1' % args[0]) child.expect('grub> ', timeout = 60) print 'Booting Linux' child.sendline('boot') Is there a way I can send a "boot" command after ktest connects to the console? -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.