aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/ktest (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-03-15ktest: force $buildonly = 1 for 'make_warnings_file' test typeRicardo B. Marliere1-0/+1
The test type "make_warnings_file" should have no mandatory configuration parameters other than the ones required by the "build" test type, because its purpose is to create a file with build warnings that may or may not be used by other subsequent tests. Currently, the only way to use it as a stand-alone test is by setting POWER_CYCLE, CONSOLE, SSH_USER, BUILD_TARGET, TARGET_IMAGE, REBOOT_TYPE and GRUB_MENU. Link: https://lkml.kernel.org/r/20240315-ktest-v2-1-c5c20a75f6a3@marliere.net Cc: John Hawley <warthog9@eaglescrag.net> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2024-03-15ktest.pl: Process variables within variablesSteven Rostedt1-6/+10
Allow a variable to contain another variable. This will allow the ${shell <command>} to have its command include variables. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2023-02-20ktest: Restore stty setting at first in dodieMasami Hiramatsu (Google)1-5/+5
The do_send_email() will call die before restoring stty if sendmail setting is not correct or sendmail is not installed. It is safer to restore it in the beginning of dodie(). Link: https://lkml.kernel.org/r/167420617635.2988775.13045295332829029437.stgit@devnote3 Cc: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2023-02-20ktest.pl: Add RUN_TIMEOUT option with default unlimitedSteven Rostedt2-4/+21
There is a disconnect between the run_command function and the wait_for_input. The wait_for_input has a default timeout of 2 minutes. But if that happens, the run_command loop will exit out to the waitpid() of the executing command. This fails in that it no longer monitors the command, and also, the ssh to the test box can hang when its finished, as it's waiting for the pipe it's writing to to flush, but the loop that reads that pipe has already exited, leaving the command stuck, and the test hangs. Instead, make the default "wait_for_input" of the run_command infinite, and allow the user to override it if they want with a default timeout option "RUN_TIMEOUT". But this fixes the hang that happens when the pipe is full and the ssh session never exits. Cc: stable@vger.kernel.org Fixes: 6e98d1b4415fe ("ktest: Add timeout to ssh command") Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2023-02-20ktest.pl: Give back console on Ctrt^C on monitorSteven Rostedt1-0/+3
When monitoring the console output, the stdout is being redirected to do so. If Ctrl^C is hit during this mode, the stdout is not back to the console, the user does not see anything they type (no echo). Add "end_monitor" to the SIGINT interrupt handler to give back the console on Ctrl^C. Cc: stable@vger.kernel.org Fixes: 9f2cdcbbb90e7 ("ktest: Give console process a dedicated tty") Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2023-02-20ktest.pl: Fix missing "end_monitor" when machine check failsSteven Rostedt1-1/+2
In the "reboot" command, it does a check of the machine to see if it is still alive with a simple "ssh echo" command. If it fails, it will assume that a normal "ssh reboot" is not possible and force a power cycle. In this case, the "start_monitor" is executed, but the "end_monitor" is not, and this causes the screen will not be given back to the console. That is, after the test, a "reset" command needs to be performed, as "echo" is turned off. 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 <rostedt@goodmis.org>
2022-12-08ktest.pl: Add shell commands to variablesSteven Rostedt (Google)2-1/+16
Allow variables to execute shell commands. Note, these are processed when they are first seen while parsing the config file. This is useful if you have the same config file used for multiple hosts (as they may be in a git repository). HOSTNAME := ${shell hostname} DEFAULTS IF "${HOSTNAME}" == "frodo" Link: https://lkml.kernel.org/r/20221207212944.277ee850@gandalf.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2022-12-07kest.pl: Fix grub2 menu handling for rebootingSteven Rostedt1-5/+15
grub2 has submenus where to use grub-reboot, it requires: grub-reboot X>Y where X is the main index and Y is the submenu. Thus if you have: menuentry 'Debian GNU/Linux' --class debian --class gnu-linux ... [...] } submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option ... menuentry 'Debian GNU/Linux, with Linux 6.0.0-4-amd64' --class debian --class gnu-linux ... [...] } menuentry 'Debian GNU/Linux, with Linux 6.0.0-4-amd64 (recovery mode)' --class debian --class gnu-linux ... [...] } menuentry 'Debian GNU/Linux, with Linux test' --class debian --class gnu-linux ... [...] } And wanted to boot to the "Linux test" kernel, you need to run: # grub-reboot 1>2 As 1 is the second top menu (the submenu) and 2 is the third of the sub menu entries. Have the grub.cfg parsing for grub2 handle such cases. Cc: stable@vger.kernel.org Fixes: a15ba91361d46 ("ktest: Add support for grub2") Reviewed-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2022-12-07ktest.pl minconfig: Unset configs instead of just removing themSteven Rostedt1-1/+2
After a full run of a make_min_config test, I noticed there were a lot of CONFIGs still enabled that really should not be. Looking at them, I noticed they were all defined as "default y". The issue is that the test simple removes the config and re-runs make oldconfig, which enables it again because it is set to default 'y'. Instead, explicitly disable the config with writing "# CONFIG_FOO is not set" to the file to keep it from being set again. With this change, one of my box's minconfigs went from 768 configs set, down to 521 configs set. Link: https://lkml.kernel.org/r/20221202115936.016fce23@gandalf.local.home Cc: stable@vger.kernel.org Fixes: 0a05c769a9de5 ("ktest: Added config_bisect test type") Reviewed-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2021-08-16bootconfig/tracing/ktest: Update ktest example for boot-time tracingMasami Hiramatsu2-6/+16
Update ktest example for the boot-time tracing with histogram options. Note that since the histogram option uses "trace()" action instead of "EVENT()", this updates the matching pattern too. Link: https://lkml.kernel.org/r/162856130208.203126.4458319094852152589.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-06-24bootconfig/tracing/ktest: Add ktest examples of testing bootconfigSteven Rostedt (VMware)9-0/+385
bootconfig is a new feature that appends scripts onto the initrd, and the kernel executes the scripts as an extended kernel command line. Need to add tests to test that the happened. To test the bootconfig properly, the initrd needs to be updated and the kernel rebooted. ktest is the perfect solution to perform these tests. Add a example bootconfig.conf in the tools/testing/ktest/examples/include and example bootconfig scripts in tools/testing/ktest/examples/bootconfig and also include verifier scripts that ktest will install on the target and run to make sure that the bootconfig options in the scripts took place after the target rebooted with the new initrd update. Link: https://lkml.kernel.org/r/20210618112647.6a81dec5@oasis.local.home Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Re-arrange the code blocks for better discoverabilityJohn 'Warthog9' Hawley (VMware)1-142/+154
Perl, as with most scripting languages, is fairly flexible in how / where you can define things, and it will (for the most part) do what you would expect it to do. This however can lead to situations, like with ktest, where things get muddled over time. This pushes the variable definitions back up to the top, followed by functions, with the main script executables down at the bottom, INSTEAD of being somewhat mish-mashed together in certain places. This mostly has the advantage of making it more obvious where things are initially defined, what functions are there, and ACTUALLY where the main script starts executing, and should make this a little more approachable. Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Further consistency cleanupsJohn 'Warthog9' Hawley (VMware)1-49/+36
This cleans up some additional whitespace pieces that to be more consistent, as well as moving a curly brace around, and some 'or' statements to match the rest of the file (usually or goes at the end of the line vs. at the beginning) Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Fixing indentation to match expected patternJohn 'Warthog9' Hawley (VMware)1-94/+92
This is a followup to "ktest: Adding editor hints to improve consistency" to actually adjust the existing indentation to match the, now, expected pattern (first column 4 spaces, 2nd tab, 3rd tab + 4 spaces, etc). This should, at least help, keep things consistent going forward now. Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Adding editor hints to improve consistencyJohn 'Warthog9' Hawley (VMware)1-0/+9
Emacs and Vi(m) have different styles of dealing with perl syntax which can lead to slightly inconsistent indentation, and makes the code slightly harder to read. Emacs assumes a more perl recommended standard of 4 spaces (1 column) or tab (two column) indentation. Vi(m) tends to favor just normal spaces or tabs depending on what was being used. This gives the basic hinting to Emacs and Vim to do what is expected to be basically consistent. Emacs: - Explicitly flip into perl mode, cperl would require more adjustments Vi(m): - Set softtabs=4 which will flip it over to doing indentation the way you would expect from Emacs Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Add example config for using VMware VMsJohn 'Warthog9' Hawley (VMware)1-0/+137
This duplicates the KVM/Qemu config with specific notes for how to use it with VMware VMs on Workstation, Player, or Fusion. The main thing to be aware of is how the serial port is exposed which is a unix pipe, and will need something like ncat to get into ktest's monitoring Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-05-03ktest: Minor cleanup with uninitialized variable $build_optionsJohn 'Warthog9' Hawley (VMware)1-0/+3
Signed-off-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-12-22Merge tag 'kbuild-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuildLinus Torvalds1-1/+1
Pull Kbuild updates from Masahiro Yamada: - Use /usr/bin/env for shebang lines in scripts - Remove useless -Wnested-externs warning flag - Update documents - Refactor log handling in modpost - Stop building modules without MODULE_LICENSE() tag - Make the insane combination of 'static' and EXPORT_SYMBOL an error - Improve genksyms to handle _Static_assert() * tag 'kbuild-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Documentation/kbuild: Document platform dependency practises Documentation/kbuild: Document COMPILE_TEST dependencies genksyms: Ignore module scoped _Static_assert() modpost: turn static exports into error modpost: turn section mismatches to error from fatal() modpost: change license incompatibility to error() from fatal() modpost: turn missing MODULE_LICENSE() into error modpost: refactor error handling and clarify error/fatal difference modpost: rename merror() to error() kbuild: don't hardcode depmod path kbuild: doc: document subdir-y syntax kbuild: doc: clarify the difference between extra-y and always-y kbuild: doc: split if_changed explanation to a separate section kbuild: doc: merge 'Special Rules' and 'Custom kbuild commands' sections kbuild: doc: fix 'List directories to visit when descending' section kbuild: doc: replace arch/$(ARCH)/ with arch/$(SRCARCH)/ kbuild: doc: update the description about kbuild Makefiles Makefile.extrawarn: remove -Wnested-externs warning tweewide: Fix most Shebang lines
2020-12-08tweewide: Fix most Shebang linesFinn Behrens1-1/+1
Change every shebang which does not need an argument to use /usr/bin/env. This is needed as not every distro has everything under /usr/bin, sometimes not even bash. Signed-off-by: Finn Behrens <me@kloenk.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-11-30ktest.pl: Fix the logic for truncating the size of the log file for emailSteven Rostedt (VMware)1-7/+6
The logic for truncating the log file for emailing based on the MAIL_MAX_SIZE option is confusing and incorrect. Simplify it and have the tail of the log file truncated to the max size specified in the config. Cc: stable@vger.kernel.org Fixes: 855d8abd2e8ff ("ktest.pl: Change the logic to control the size of the log file emailed") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-11-30ktest.pl: If size of log is too big to email, email error messageSteven Rostedt (VMware)1-1/+6
If the size of the error log is too big to send via email, and the sending fails, it wont email any result. This can be confusing for the user who is waiting for an email on the completion of the tests. If it fails to send email, then try again without the log file stating that it failed to send an email. Obviously this will not be of use if the sending of email failed for some other reasons, but it will at least give the user some information when it fails for the most common reason. Cc: stable@vger.kernel.org Fixes: c2d84ddb338c8 ("ktest.pl: Add MAIL_COMMAND option to define how to send email") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-11-30ktest.pl: Fix incorrect reboot for grub2blsLibo Chen1-1/+1
This issue was first noticed when I was testing different kernels on Oracle Linux 8 which as Fedora 30+ adopts BLS as default. Even though a kernel entry was added successfully and the index of that kernel entry was retrieved correctly, ktest still wouldn't reboot the system into user-specified kernel. The bug was spotted in subroutine reboot_to where the if-statement never checks for REBOOT_TYPE "grub2bls", therefore the desired entry will not be set for the next boot. Add a check for "grub2bls" so that $grub_reboot $grub_number can be run before a reboot if REBOOT_TYPE is "grub2bls" then we can boot to the correct kernel. Link: https://lkml.kernel.org/r/20201121021243.1532477-1-libo.chen@oracle.com Cc: stable@vger.kernel.org Fixes: ac2466456eaa ("ktest: introduce grub2bls REBOOT_TYPE option") Signed-off-by: Libo Chen <libo.chen@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-08-10Merge tag 'ktest-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktestLinus Torvalds2-16/+105
Pull ktest updates from Steven Rostedt: - Have config-bisect save the good/bad configs at each step. - Show log file location even on success - Add PRE_TEST_DIE to kill test if the PRE_TEST fails - Add a NOT operator for conditionals in config file - Add the log output of the last test when emailing on failure. - Other minor clean ups and small fixes. * tag 'ktest-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest.pl: Fix spelling mistake "Cant" -> "Can't" ktest.pl: Change the logic to control the size of the log file emailed ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed ktest.pl: Add the log of last test in email on failure ktest.pl: Turn off buffering to the log file ktest.pl: Just open up the log file once ktest.pl: Add a NOT operator ktest.pl: Define PRE_TEST_DIE to kill the test if the PRE_TEST fails ktest.pl: Always show log file location if defined even on success ktest.pl: Have config-bisect save each config used in the bisect
2020-08-10ktest.pl: Fix spelling mistake "Cant" -> "Can't"Colin Ian King1-1/+1
There is a spelling mistake in an error message. Fix it. Link: https://lkml.kernel.org/r/20200810100750.61475-1-colin.king@canonical.com Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-08-10ktest.pl: Change the logic to control the size of the log file emailedSteven Rostedt (VMware)1-3/+6
If the log file for a given test is larger than the max size given then use set the seek from the end of the log file instead of from the start of the test. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-08-07tools/: replace HTTP links with HTTPS onesAlexander A. Klimov2-2/+2
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20200726120752.16768-1-grandmaster@al2klimov.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-07-02ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailedSteven Rostedt (VMware)2-1/+24
Add the ktest config option MAIL_MAX_SIZE that will limit the size of the log file that is placed into the email on failure. Link: https://lore.kernel.org/r/20200701231756.790637968@goodmis.org Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-02ktest.pl: Add the log of last test in email on failureSteven Rostedt (VMware)1-4/+38
If a failure happens and an email is sent, show the contents of the log of the last test that failed in the email. Link: http://lore.kernel.org/r/20200701231756.619246244@goodmis.org Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Turn off buffering to the log fileSteven Rostedt (VMware)1-0/+2
The log file should be up to date to whatever is happening in ktest. Disable buffering to the LOG output file handle. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Just open up the log file onceSteven Rostedt (VMware)1-12/+12
Currently, every write to the log file is done by opening the file, writing to it, then closing the file. This rather expensive. Just open it at the beginning and close it at the end. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Add a NOT operatorSteven Rostedt (VMware)1-0/+6
There is a NOT DEFINED operator, but there is not an operator that can negate any other expression. For example: NOT (${FOO} == boot || ${BAR} == run) Add the keyword NOT to allow the ktest.pl config files to negate operators. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Define PRE_TEST_DIE to kill the test if the PRE_TEST failsSteven Rostedt (VMware)2-1/+12
Currently, if a PRE_TEST is defined and ran, but fails, there's nothing currently available to make the test fail too. Add a PRE_TEST_DIE option that when set, if a PRE_TEST is defined and fails, the test will die too. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Always show log file location if defined even on successSteven Rostedt (VMware)1-0/+4
If a log file is defined and the test were to error, a print statement is made that shows the user where the log file is to examine it further. But this is not done if the test were to succeed. I find it annoying that it does not show where the log file is on success, as I run several different tests that place their log files in various locations, and even though the test pass, there's things I want to look at in the log file (like warnings). It is much easier to find where the log file is, if it is displayed at the end of a test. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-07-01ktest.pl: Have config-bisect save each config used in the bisectSteven Rostedt (VMware)1-2/+8
When performing a automatic config bisect via ktest.pl, it is very useful to have a copy of each of the bisects used. This way, if a bisect were to go wrong, it is possible to retrace the steps and continue at the location before the error was made. The ktest.pl will make a copy of the good and bad configs, labeled as such, as well as a number attached to it that represents the iteration of the bisect. These files are saved in the ktest temp directory where it currently stores the good and bad config files. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
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)2-2/+2
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>
2020-03-09ktest: Fix some typos in sample.confMasanari Iida1-10/+10
This patch fixes some spelling typo in sample.conf Link: http://lkml.kernel.org/r/20190930124925.20250-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>
2019-07-24ktest: Fix some typos in config-bisect.plMasanari Iida1-2/+2
This patch fixes some spelling typos in config-bisect.pl Link: http://lkml.kernel.org/r/20190723032445.14220-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>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166Thomas Gleixner2-3/+2
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: update sample.conf for grub2blsMasayoshi Mizuma1-2/+18
Update sample.conf for grub2bls Link: http://lkml.kernel.org/r/20190509213647.6276-7-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: 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 Mizuma2-0/+13
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 Torvalds3-272/+1091
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 ...