path: root/tools/testing/ktest/ktest.pl (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-09ktest: Fix typos in ktest.plMasanari Iida1-6/+6
This patch fixes multipe spelling typo found in ktest.pl. Link: http://lkml.kernel.org/r/20200309115430.57540-1-standby24x7@gmail.com Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-03-09ktest: Add timeout for ssh sync testingSteven Rostedt (VMware)1-1/+1
Before rebooting the box, a "ssh sync" is called to the test machine to see if it is alive or not. But if the test machine is in a partial state, that ssh may never actually finish, and the ktest test hangs. Add a 10 second timeout to the sync test, which will fail after 10 seconds and then cause the test to reboot the test machine. Cc: stable@vger.kernel.org Fixes: 6474ace999edd ("ktest.pl: Powercycle the box on reboot if no connection can be made") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-03-09ktest: Make default build option oldconfig not randconfigSteven Rostedt (VMware)1-1/+1
For the last time, I screwed up my ktest config file, and the build went into the default "randconfig", blowing away the .config that I had set up. The reason for the default randconfig was because when this was first written, I wanted to do a bunch of randconfigs. But as time progressed, ktest isn't about randconfig anymore, and because randconfig destroys the config in the build directory, it's a dangerous default to have. Use oldconfig as the default. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166Thomas Gleixner1-1/+1
Based on 1 normalized pattern(s): licensed under the terms of the gnu gpl license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 62 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.929121379@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-10ktest: remove get_grub2_indexMasayoshi Mizuma1-36/+0
Remove get_grub2_index() because it isn't used anywhere. Link: http://lkml.kernel.org/r/20190509213647.6276-6-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-05-10ktest: pass KERNEL_VERSION to POST_KTESTMasayoshi Mizuma1-1/+3
For BLS, kernel entry is added by kernel-install command through POST_INSALL, for example, POST_INSTALL = ssh root@Test "/usr/bin/kernel-install \ add $KERNEL_VERSION /boot/vmlinuz-$KERNEL_VERSION" The entry is removed by kernel-install command and the kernel version is needed for the argument. Pass KERNEL_VERSION variable to POST_KTEST so that kernel-install command can remove the entry like as follows: POST_KTEST = ssh root@Test "/usr/bin/kernel-install remove $KERNEL_VERSION" Link: http://lkml.kernel.org/r/20190509213647.6276-5-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-05-10ktest: introduce grub2bls REBOOT_TYPE optionMasayoshi Mizuma1-3/+15
Fedora 30 introduces Boot Loader Specification (BLS), it changes around grub entry configuration. kernel entries aren't in grub.cfg. We can get the entries by "grubby --info=ALL" command. Introduce grub2bls as REBOOT_TYPE option for BLS. Link: http://lkml.kernel.org/r/20190509213647.6276-4-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-05-10ktest: cleanup get_grub_indexMasayoshi Mizuma1-33/+17
Cleanup get_grub_index(). Link: http://lkml.kernel.org/r/20190509213647.6276-3-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-05-10ktest: introduce _get_grub_indexMasayoshi Mizuma1-0/+37
Introduce _get_grub_index() to deal with Boot Loader Specification (BLS) and cleanup. Link: http://lkml.kernel.org/r/20190509213647.6276-2-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-04-18ktest: introduce REBOOT_RETURN_CODE to confirm the result of REBOOTMasayoshi Mizuma1-0/+9
Unexpected power cycle occurs while the installation of the kernel. ssh root@Test sync ... [0 seconds] SUCCESS ssh root@Test reboot ... [1 second] FAILED! virsh destroy Test; sleep 5; virsh start Test ... [6 seconds] SUCCESS That is because REBOOT, the default is "ssh $SSH_USER@$MACHINE reboot", exits as 255 even if the reboot is successfully done, like as: ]# ssh root@Test reboot Connection to Test closed by remote host. ]# echo $? 255 ]# To avoid the unexpected power cycle, introduce a new parameter, REBOOT_RETURN_CODE to judge whether REBOOT is successfully done or not. Link: http://lkml.kernel.org/r/20190418135943.12640-1-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-04-17ktest: Add support for meta characters in GRUB_MENUMasayoshi Mizuma1-2/+4
ktest fails if meta characters are in GRUB_MENU, for example GRUB_MENU = 'Fedora (test)' The failure happens because the meta characters are not escaped, so the menu doesn't match in any entries in GRUB_FILE. Use quotemeta() to escape the meta characters. Link: http://lkml.kernel.org/r/20190417235823.18176-1-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-04-17ktest: Show name and iteration on errorsSteven Rostedt (VMware)1-6/+20
If a test has an error, display not only the what type of test failed, but if the test was giving a name, display that too, as well as the current iteration of the tests. Each test has an iteration number associated to it. For error messages display that iteration number along with the test type and test name. This includes the message that gets sent via email. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-11Merge tag 'ktest-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktestLinus Torvalds1-272/+261
Pull ktest updates from Steven Rostedt: "These commits have either been sitting in my INBOX or have been in my local tree for some time. I need to push them upstream: - Separate out config-bisect.pl from ktest.pl. This allows users to do config bisects without full ktest setup. - Email on status change. Allow the user to be emailed on test start, finish, failure, etc. - Other small fixes and enhancements" * tag 'ktest-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: (24 commits) ktest: Take submenu into account for grub2 menus ktest.pl: Add MAIL_COMMAND option to define how to send email ktest.pl: Use run_command to execute sending mail ktest.pl: Allow dodie be recursive ktest.pl: Kill test if mailer is not supported ktest.pl: Add MAIL_PATH option to define where to find the mailer ktest.pl: No need to print no mailer is specified when mailto is not Ktest: add email options to sample.config Ktest: Use dodie for critical falures Ktest: Add SigInt handling Ktest: Add email support ktest.pl: Detect if a config-bisect was interrupted ktest.pl: Make finding config-bisect.pl dynamic ktest.pl: Have ktest.pl pass -r to config-bisect.pl to reset bisect ktest.pl: Use diffconfig if available for failed config bisects ktest.pl: Allow for the config-bisect.pl output to display to console ktest: Use config-bisect.pl in ktest.pl ktest: Add standalone config-bisect.pl program ktest: Set do_not_reboot=y for CONFIG_BISECT_TYPE=build ktest: Set buildonly=1 for CONFIG_BISECT_TYPE=build ...
2018-04-10ktest: Take submenu into account for grub2 menusSatoru Takeuchi1-1/+1
grub-reboot selects the submenu's first menuentry (title is "1>0") rather than ktest's menuentry (title is "2") by mistake. === $ sudo cat /boot/grub/grub.cfg | grep -E "^menuentry|^submenu" ... menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option '...' { ... submenu 'Advanced options for Ubuntu' $menuentry_id_option '...' { ... menuentry 'ktest' { ... === Correct it by taking submenu entries into account in get_grub2_index(). Link: http://lkml.kernel.org/r/87poaje4as.wl-satoru.takeuchi@gmail.com Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-07ktest.pl: Add MAIL_COMMAND option to define how to send emailSteven Rostedt (VMware)1-20/+34
Allow the user to override the default way to send email. This will allow the user to add their own mailer and format for sending email. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-07ktest.pl: Use run_command to execute sending mailSteven Rostedt (VMware)1-2/+2
Instead of open coding system() call, use run_command which will log the sending of email as well. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-07ktest.pl: Allow dodie be recursiveSteven Rostedt (VMware)1-0/+7
If dodie cause a function that itself will call dodie, then be able to handle that. This will allow dodie functions to call run_command, which could possibly call dodie. If dodie is called again, simply ignore it. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-07ktest.pl: Kill test if mailer is not supportedSteven Rostedt (VMware)1-1/+1
If the user specifies a MAILTO, but the MAILER is not supported, then kill the test. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-07ktest.pl: Add MAIL_PATH option to define where to find the mailerSteven Rostedt (VMware)1-5/+31
The option MAIL_PATH lets the user decide how to find the mailer they are using. For example, sendmail is usually located in /usr/sbin but is not always in the path of non admin users. Have ktest look through the user's PATH environment variable (adding /usr/sbin) as well, but if that's not good enough, allow the user to define where to find the mailer. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> squash to mail exec Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: No need to print no mailer is specified when mailto is notSteven Rostedt (VMware)1-3/+5
If the user doesn't want to send mail, then don't bother them with output that says they didn't specify a mailer. That can be annoying. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06Ktest: Use dodie for critical faluresTim Tianyang Chen1-27/+27
Users should get emails when the script dies because of a critical failure. Critical failures are defined as any errors that could abnormally terminate the script. In order to add email support, this patch converts all die() to dodie() except: * when '-v' is used as an option to get the version of the script. * in Sig-Int handeler because it's not a fatal error to cancel the script. * errors happen during parsing config Link: http://lkml.kernel.org/r/1522094884-22718-4-git-send-email-tianyang.chen@oracle.com Suggested-by: Dhaval Giani <dhaval.giani@oracle.com> Signed-off-by: Tim Tianyang Chen <tianyang.chen@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06Ktest: Add SigInt handlingTim Tianyang Chen1-0/+10
User can cancel tests and specify handler's behavior using option 'EMAIL_WHEN_CANCELED'. Link: http://lkml.kernel.org/r/1522094884-22718-3-git-send-email-tianyang.chen@oracle.com Suggested-by: Dhaval Giani <dhaval.giani@oracle.com> Signed-off-by: Tim Tianyang Chen <tianyang.chen@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06Ktest: Add email supportTim Tianyang Chen1-3/+58
Users can define optional variables to get email notifications. Ktest can send emails when the script: * was started * failed with fatal errors and called dodie() * completed all testing Users have to setup the mailer provided in config prior to using this script. Supported mailers: mailx, mail, sendmail mailer specific routines are _sendmail_send(), _mailx_send() Link: http://lkml.kernel.org/r/1522094884-22718-2-git-send-email-tianyang.chen@oracle.com Suggested-by: Dhaval Giani <dhaval.giani@oracle.com> Signed-off-by: Tim Tianyang Chen <tianyang.chen@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: Detect if a config-bisect was interruptedSteven Rostedt (VMware)1-0/+14
If a config-bisect was interrupted, then allow the user to continue, or restart a new config-bisect. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: Make finding config-bisect.pl dynamicSteven Rostedt (VMware)1-1/+26
Just looking for config-bisect.pl in the source tree can be risky, especially, if the source tree being tested doesn't have config-bisect.pl in place. Instead, allow the user to set where to find config-bisect.pl with a new option CONFIG_BISECT_EXEC. If this option is not set, by default, ktest.pl will look for config-bisect.pl in the following locations: `pwd`/config-bisect.pl # where ktest.pl was called from `dirname /path/to/ktest.pl`/config-bisect.pl # where ktest.pl exists ${BUILD_DIR}/tools/testing/ktest/config-bisect.pl # where config-bisect.pl exists in the source tree. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: Have ktest.pl pass -r to config-bisect.pl to reset bisectSteven Rostedt (VMware)1-1/+5
If config-bisect.pl sees that a config_bisect has already been started, it will ask on the command line if it should bisect or not. This will mess up running config_bisect from ktest.pl. Have ktest.pl pass in '-r' to config-bisect.pl and have config-bisect.pl recognize that to reset without asking. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: Use diffconfig if available for failed config bisectsSteven Rostedt (VMware)1-1/+5
Check to see if diffconfig is available and use that to diff the configs instead of using 'diff -u', as diffconfig produces much better output of kernel config files. It checks the source directory for the executable. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest.pl: Allow for the config-bisect.pl output to display to consoleSteven Rostedt (VMware)1-4/+12
When commands are run in ktest, they are only displayed in the ktest log file, but that is not sufficient for outputting the display for config bisects. The result of a config bisect is not shown. Add a way to display the output of "run_command" which is the subroutine used by ktest to execute commands. Use this feature to display the output of config-bisect.pl executions to see the progress as well as the result. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-06ktest: Use config-bisect.pl in ktest.plScott Wood1-222/+42
Reduce code duplication and take advantage of bisection logic improvements by calling config-bisect.pl. The output of make oldconfig is now copied directly to the desired file, rather than doing assign_configs+save_config, in order to preserve the ordering so that diffing the configs at the end will provide useful output. Link: http://lkml.kernel.org/r/20170717001630.10518-8-swood@redhat.com Signed-off-by: Scott Wood <swood@redhat.com> [ Modified to use with new version of config-bisect.pl ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-21ktest: Set do_not_reboot=y for CONFIG_BISECT_TYPE=buildScott Wood1-1/+2
Currently setting do_not_reboot is triggered by simple builds and bisect builds, but not config bisect builds. Link: http://lkml.kernel.org/r/20170717001630.10518-3-swood@redhat.com Signed-off-by: Scott Wood <swood@redhat.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-21ktest: Set buildonly=1 for CONFIG_BISECT_TYPE=buildScott Wood1-13/+5
Rather than adding a third copy of the same logic, rework it to cover all three buildonly cases at once. In the future, please consider using the same variable to perform the same function regardless of context... Link: http://lkml.kernel.org/r/20170717001630.10518-2-swood@redhat.com Signed-off-by: Scott Wood <swood@redhat.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-21ktest: Clarify config file usageScott Wood1-1/+2
Simply telling a new user to edit "the config file" without giving any hints on where that file should go, what it should be named, or where a template can be found, is not particularly helpful. Link: http://lkml.kernel.org/r/20170717001630.10518-1-swood@redhat.com Signed-off-by: Scott Wood <swood@redhat.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-21ktest: Add CONNECT_TIMEOUT to change the connection timeout timeSteven Rostedt (VMware)1-2/+5
Before ktest issues a reboot, it will try to connect to the target machine to make sure that it is still alive. If the target does not respond within 5 seconds, it will power cycle the box instead of issuing a reboot. Five seconds may be too short, and ktest may unnecessarially power cycle the box. I have found 25 seconds seems to be a better timeout for this purpose. But even 25 may be too arbitrary. Add a CONNECT_TIMEOUT option to let the user determine the timeout time before rebooting. By default, it has been raised to 25 seconds. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-21ktest: Wait for console process to exitSteven Rostedt (VMware)1-0/+3
To clean up the console processes that are forked to monitor the console, there needs to be a waitpid(). Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-03-16arch: remove tile portArnd Bergmann1-2/+0
The Tile architecture port was added by Chris Metcalf in 2010, and maintained until early 2018 when he orphaned it due to his departure from Mellanox, and nobody else stepped up to maintain it. The product line is still around in the form of the BlueField SoC, but no longer uses the Tile architecture. There are also still products for sale with Tile-GX SoCs, notably the Mikrotik CCR router family. The products all use old (linux-3.3) kernels with lots of patches and won't be upgraded by their manufacturers. There have been efforts to port both OpenWRT and Debian to these, but both projects have stalled and are very unlikely to be continued in the future. Given that we are reasonably sure that nobody is still using the port with an upstream kernel any more, it seems better to remove it now while the port is in a good shape than to let it bitrot for a few years first. Cc: Chris Metcalf <chris.d.metcalf@gmail.com> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Link: http://www.mellanox.com/page/npu_multicore_overview Link: https://jenkins.debian.net/view/rebootstrap/job/rebootstrap_tilegx_gcc7/ Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-03-08Merge tag 'ktest-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktestLinus Torvalds1-8/+13
Pull ktest fixes from Steven Rostedt: "Greg Kroah-Hartman reported to me that the ktest of v4.11-rc1 locked up in an infinite loop while doing the make mrproper. Looking into the cause I noticed that a recent update to the function run_command (used for running all shell commands, including "make mrproper") changed the internal loop to use the function wait_for_input. The wait_for_input function uses select to look at two file descriptors. One is the file descriptor of the command it is running, the other is STDIN. The STDIN check was not checking the return status of the sysread call, and was also just writing a lot of data into syswrite without regard to the size of the data read. Changing the code to check the return status of sysread, and also to still process the passed in descriptor data without looping back to the select fixed Greg's problem. While looking at this code I also realized that the loop did not honor the timeout if STDIN always had input (or for some reason return error). this could prevent wait_for_input to timeout on the file descriptor it is suppose to be waiting for. That is fixed too" * tag 'ktest-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Make sure wait_for_input does honor the timeout ktest: Fix while loop in wait_for_input
2017-03-08ktest: Make sure wait_for_input does honor the timeoutSteven Rostedt (VMware)1-7/+11
The function wait_for_input takes in a timeout, and even has a default timeout. But if for some reason the STDIN descriptor keeps sending in data, the function will never time out. The timout is to wait for the data from the passed in file descriptor, not for STDIN. Adding a test in the case where there's no data from the passed in file descriptor that checks to see if the timeout passed, will ensure that it will timeout properly even if there's input in STDIN. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-03-08ktest: Fix while loop in wait_for_inputSteven Rostedt (VMware)1-3/+4
The run_command function was changed to use the wait_for_input function to allow having a timeout if the command to run takes too much time. There was a bug in the wait_for_input where it could end up going into an infinite loop. There's two issues here. One is that the return value of the sysread wasn't used for the write (to write a proper size), and that it should continue processing the passed in file descriptor too even if there was input. There was no check for error, if for some reason STDIN returned an error, the function would go into an infinite loop and never exit. Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Fixes: 6e98d1b4415f ("ktest: Add timeout to ssh command") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-02-27Merge tag 'ktest-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktestLinus Torvalds1-35/+76
Pull ktest updates from Steven Rostedt: "These are various fixes that I have made and never got around to pushing. I've been asked to get the upstream repo back up-to-date" * tag 'ktest-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Add variable run_command_status to save status of commands executed ktest.pl: Powercycle the box on reboot if no connection can be made ktest: Add timeout to ssh command ktest: Fix child exit code processing ktest: Have POST_TEST run after the test has totally completed
2017-02-07ktest: Add variable run_command_status to save status of commands executedSteven Rostedt (VMware)1-11/+11
Create a variable called run_command_status that saves the status of the executed commands and can be used by other functions later to test for status. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-02-07ktest.pl: Powercycle the box on reboot if no connection can be madeSteven Rostedt (VMware)1-11/+29
When performing a reboot of the test box, try to ssh to it. If it can't connect for 5 seconds, then powercycle the box. This is useful because the reboot is done via ssh, and if you can't ssh to the box because it is hung, the reboot fails to reboot. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-02-07ktest: Add timeout to ssh commandSteven Rostedt (VMware)1-8/+27
Add a timeout to performing an ssh command. This will let testing if a machine is alive or not, or if something else may be amiss. A timeout can be passed to ssh, where ssh will fail if it does not complete within the given timeout. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-02-07ktest: Fix child exit code processingSteven Rostedt (VMware)1-1/+1
The child_exit errno needs to be shifted by 8 bits to compare against the return values for the bisect variables. Fixes: c5dacb88f0a64 ("ktest: Allow overriding bisect test results") Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-02-07ktest: Have POST_TEST run after the test has totally completedSteven Rostedt (VMware)1-8/+12
The POST_TEST config is to be executed after a test has fully compeleted, whether the test passed or failed. It currently is executed at the moment that the test has been decided if it failed or not. As the test does other clean ups, it isn't truly finished. Move the POST_TEST execution to after all the test cleanups have been done. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2016-12-14ktest.pl: fix englishPavel Machek1-4/+4
Ajdust spelling to more common "mandatory". Variant "mandidory" is certainly wrong. Link: http://lkml.kernel.org/r/20161011073003.GA19476@amd Signed-off-by: Pavel Machek <pavel@ucw.cz> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-03ktest: Place quotes around item variableSteven Rostedt (Red Hat)1-1/+1
Seems that some of the new console logic causes doprint to possibly get evaluated. When printing a commit message that contains parenthesis, it fails with a shell parsing error. This gets fixed when we add quotes around the $item variable, and prevent it from being evaluated by any shell commands. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2015-02-02ktest: Cleanup terminal on dodie() failureJosh Poimboeuf1-1/+6
If dodie() is called with the console open, restore the terminal's original settings before dying. Link: http://lkml.kernel.org/r/20150130025453.GB20952@treble.redhat.com Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2015-02-02ktest: Print build,install,boot,test times at success and failureSteven Rostedt (Red Hat)1-0/+4
Since both success and failure may shortcut and exit ktest, it is better to print the status times there too. Once times are printed, the values for the times are reset, so they will not print more than once. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2015-02-02ktest: Enable user input to the consoleJosh Poimboeuf1-15/+36
Allow the user to send input to the console by putting the terminal in cbreak mode (to allow reading stdin one character at a time) and copying all stdin data to the console's pty. Link: http://lkml.kernel.org/r/bb1bbe7d202c95a3ce7894cfffdd8c725875978e.1422473610.git.jpoimboe@redhat.com Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2015-02-02ktest: Give console process a dedicated ttyJosh Poimboeuf1-9/+57
Create a pseudoterminal (pty pair) to give the console a dedicated tty so it doesn't mess with ktest's terminal settings. Link: http://lkml.kernel.org/r/37b0127f9efad09ff4fc994334db998141e4f6ca.1422473610.git.jpoimboe@redhat.com Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>