Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618198

Re: ktest help

From Timur Tabi <timur@codeaurora.org>
Newsgroups linux.kernel
Subject Re: ktest help
Date 2017-04-06 19:10 +0200
Message-ID <ttj50-3IL-5@gated-at.bofh.it> (permalink)
References <ttiLD-3md-23@gated-at.bofh.it> <ttiLD-3md-25@gated-at.bofh.it> <ttiLD-3md-27@gated-at.bofh.it> <ttiLD-3md-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: ktest help Steven Rostedt <rostedt@goodmis.org> - 2017-04-06 18:50 +0200
  Re: ktest help Steven Rostedt <rostedt@goodmis.org> - 2017-04-06 19:10 +0200
    Re: ktest help Timur Tabi <timur@codeaurora.org> - 2017-04-06 20:50 +0200
      Re: ktest help Steven Rostedt <rostedt@goodmis.org> - 2017-04-06 21:00 +0200
        Re: ktest help Timur Tabi <timur@codeaurora.org> - 2017-04-06 21:00 +0200
          Re: ktest help Steven Rostedt <rostedt@goodmis.org> - 2017-04-06 21:20 +0200
  Re: ktest help Timur Tabi <timur@codeaurora.org> - 2017-04-06 19:10 +0200

csiph-web