mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Timur Tabi <timur@codeaurora.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "John 'Warthog9' Hawley" <warthog9@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: ktest help
Date: Thu, 6 Apr 2017 12:01:37 -0500	[thread overview]
Message-ID: <37da87f8-afb8-70a4-c6e7-b83525210437@codeaurora.org> (raw)
In-Reply-To: <20170406124901.0e5efe12@gandalf.local.home>

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.

  reply	other threads:[~2017-04-06 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c2619a27-eca9-c80d-ea62-e5536ccf6ae6@codeaurora.org>
     [not found] ` <20170405215350.0c43734c@grimm.local.home>
     [not found]   ` <d034a112-f58b-16b3-babb-f5528f1ee399@codeaurora.org>
2017-04-06 16:49     ` Steven Rostedt
2017-04-06 17:01       ` Timur Tabi [this message]
2017-04-06 17:05         ` Steven Rostedt
2017-04-06 18:39           ` Timur Tabi
2017-04-06 18:50             ` Steven Rostedt
2017-04-06 18:53               ` Timur Tabi
2017-04-06 19:14                 ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37da87f8-afb8-70a4-c6e7-b83525210437@codeaurora.org \
    --to=timur@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=warthog9@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®