Lines Matching +full:fails +full:- +full:without +full:- +full:test +full:- +full:cd
1 #!/usr/bin/perl -w
2 # SPDX-License-Identifier: GPL-2.0-only
4 # Copyright 2010 - Steven Rostedt <[email protected]>, Red Hat Inc.
67 "GRUB_REBOOT" => "grub2-reboot",
68 "GRUB_BLS_GET" => "grubby --info=ALL",
76 "LOCALVERSION" => "-test",
79 "TARGET_IMAGE" => "/boot/vmlinuz-test",
242 # set when a test is something other that just building or install
304 "TEST" => \$run_test,
393 The machine hostname that you will test.
422 i.e. -j20
426 The place to put your image on the test machine.
433 …POWER_CYCLE = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin\@power/outl…
444 CONSOLE = nc -d localhost 3001
451 Required version ending to differentiate the test
456 Way to reboot the box to the test kernel.
466 The test will not modify that file.
476 SYSLINUX_LABEL to define the label to boot to for the test kernel.
480 The grub title name for the test kernel to boot
484 manually add an option for the test. ktest.pl will search
488 For example, if in the /boot/grub/menu.lst the test kernel title has:
489 title Test Kernel
490 kernel vmlinuz-test
491 GRUB_MENU = Test Kernel
495 menu must be a non-nested menu. Add the quotes used in the menu
514 A script to reboot the target into the test kernel
689 $time -= $hours * 3600;
693 $time -= $minutes * 60;
730 doprint "Test time: ";
856 if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ &&
862 # Note if a test is something other than build, then we
939 return -1;
967 $d--;
1176 if (-f "$1/$file") {
1182 if ( ! -r $file ) {
1190 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1204 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1238 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1260 $test_num += $repeat - 1;
1272 print "What test case would you like to run?\n";
1292 # was a test specified?
1294 print "No test case specified.\n";
1315 # remove per test labels.
1333 exit -1;
1347 foreach my $test (keys %repeat_tests) {
1348 if ($i >= $test &&
1349 $i < $test + $repeat_tests{$test}) {
1352 $parent = $test;
1366 # otherwise see if the default OPT (without [$i]) exists.
1458 # test if the machine can be connected to within a few seconds
1562 doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n";
1583 my $size = $log_size - $test_log_start;
1590 my $pos = - $size;
1602 send_email("KTEST: critical failure for test $i [$name]",
1603 "Your test started at $script_start_time has failed with:\n@_\n", $log_file);
1661 $stty_orig = `stty -g`;
1664 # a time without having to wait for a newline
1665 system("stty -icanon -echo -icrnl");
1714 if (--$monitor_cnt) {
1763 if ($full_line =~ /Kernel panic -/) {
1771 if ($now - $start_time >= $max_monitor_wait) {
1797 my $dir = "$machine-$test_type-$type-$result-$date";
1801 if (!-d $dir) {
1814 if (-f "$source") {
1849 doprint "KTEST RESULT: TEST $i$name Failed: ", @_, "\n";
1882 $timeout = -1; # tell wait_for_input to wait indefinitely
1914 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1939 my $delta = $end_time - $start_time;
2002 $grub_number = -1;
2021 $grub_number = -1;
2110 last if (defined($time) && (time - $start_time > $time));
2135 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2139 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2149 doprint "git rev-list --max-count=1 $commit ... ";
2150 my $sha1 = `git rev-list --max-count=1 $commit`;
2195 my $time = $stop_after_failure - (time - $failure_start);
2199 doprint "Test forced to stop after $stop_after_failure seconds after failure\n";
2232 if ($now - $success_start >= $stop_after_success) {
2233 doprint "Test forced to stop after $stop_after_success seconds after success\n";
2256 if ($now - $failure_start >= $stop_after_failure) {
2257 doprint "Test forced to stop after $stop_after_failure seconds after failure\n";
2266 if ($full_line =~ /Kernel panic -/) {
2292 if (time - $monitor_start > $stop_test_after) {
2300 $reboot_time = $end_time - $start_time;
2306 fail "failed - got a bug report" and return 0;
2311 fail "failed - never got a boot prompt." and return 0;
2338 # Sometimes the reboot fails, and will hang. We try to ssh to the box
2384 $install_time = $end_time - $start_time;
2392 my $modtar = "ktest-mods.tar.bz2";
2394 run_ssh "rm -rf $modlib" or
2397 # would be nice if scp -r did not follow symbolic links
2398 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2406 run_ssh "'(cd / && tar xjf /tmp/$modtar)'" or
2409 run_ssh "rm -f /tmp/$modtar";
2414 $install_time = $end_time - $start_time;
2421 $version = `$make -s kernelrelease | tail -1`;
2425 $version = `$make -s kernelrelease | tail -1`;
2465 # Some compilers use UTF-8 extended for quotes and some don't.
2483 if (-f $warnings_file) {
2522 my @files = `git show $patch | diffstat -l`;
2531 if (m,^--- a/(.*),) {
2567 if (-f $output_config) {
2720 $build_time = $end_time - $start_time;
2753 doprint "KTEST RESULT: TEST $i$name SUCCESS!!!! **\n";
2781 return -1;
2816 doprint "run test $run_test\n";
2844 if ($full_line =~ /Kernel panic -/) {
2867 if ($now - $failure_start >= $stop_after_failure) {
2881 $test_time = $end_time - $start_time;
2891 return -1;
2896 fail "test abort" and return -2;
2910 return -1;
2912 return -2;
2915 and return -2;
2922 fail "test failed" and return 0;
2962 # returns 1 on success, 0 on failure, -1 on skip
2976 return -1;
2988 return -1;
3083 $start_files = " -- " . $start_files;
3099 # Can't have a test without having a test to run
3100 if ($type eq "test" && !defined($run_test)) {
3110 if ( -f $bisect_start_file ) {
3180 my $test;
3183 $test = run_git_bisect "git bisect $result";
3185 } while ($test);
3281 my $diffexec = "diff -u";
3283 if (-f "$builddir/scripts/diffconfig") {
3299 $reset = "-r";
3301 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3303 # config-bisect returns:
3307 # -1 (255) on error
3356 "$pwd/config-bisect.pl",
3357 "$dirname/config-bisect.pl",
3358 "$builddir/tools/testing/ktest/config-bisect.pl",
3363 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3366 fail "Could not find an executable config-bisect.pl\n",
3367 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3373 doprint "Disabling 'MIN_CONFIG' for this test\n";
3380 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3381 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3382 if (-f "$tmpdir/good_config.tmp") {
3387 if (-f "$tmpdir/bad_config.tmp") {
3481 # Can't have a test without having a test to run
3482 if ($type eq "test" && !defined($run_test)) {
3487 open (IN, "git cherry -v $start $end|") or
3490 open (IN, "git log --pretty=oneline $end|") or
3514 doprint("Going to test the following commits:\n");
3612 if (! -f $kconfig) {
3664 $deps =~ s/^[^a-zA-Z0-9_]*//;
3665 $deps =~ s/[^a-zA-Z0-9_]*$//;
3667 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3673 $iflevel-- if ($iflevel);
3718 if (! -f $kconfig && $arch =~ /\d$/) {
3723 if (! -f $kconfig) {
3764 my $valid = "A-Za-z_0-9";
3801 # Test dependencies first
3841 if ($type ne "boot" && $type ne "test") {
3843 " make_min_config works only with 'boot' and 'test'\n" and return;
3853 if (-f $output_minconfig && !$start_minconfig_defined) {
3969 # if every test config has failed to modify the .config file
4002 doprint "Test with $config disabled\n";
4012 if ($type eq "test" && !$failed) {
4041 # We booted without this config, remove it from the minconfigs.
4084 dodie "Must define WARNINGS_FILE for make_warnings_file test";
4088 dodie "BUILD_TYPE can not be 'nobuild' for make_warnings_file test";
4097 # Some compilers use UTF-8 extended for quotes
4131 foreach my $test (keys %repeat_tests) {
4132 if ($i >= $test &&
4133 $i < $test + $repeat_tests{$test}) {
4134 $option = "$name\[$test\]";
4166 if (-x "$path/$mailer") {
4194 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4196 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4217 # try again without the file
4239 send_email("KTEST: Your [$name] test was cancelled",
4240 "Your test started at $script_start_time was cancelled: sig int");
4242 die "\nCaught Sig Int, test interrupted: $!\n"
4245 $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
4249 if (! -f $ktest_config) {
4257 if (! -f $ktest_config) {
4271 # move the test cases to other locations or to other machines.
4275 # Define each test with TEST_START
4288 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4307 if (! -e $opt{"LOG_FILE"} && $opt{"LOG_FILE"} =~ m,^(.*/),) {
4309 if (! -d $dir) {
4315 LOG->autoflush(1);
4349 # Do not reboot on failing test options
4371 if (!-d $outputdir) {
4385 # The first test may override the PRE_KTEST option
4393 send_email("KTEST: Your [$name] test was started",
4394 "Your test was started on $script_start_time");
4398 # Any test can override the POST_KTEST option
4399 # The last test takes precedence.
4409 if (!-d $tmpdir) {
4417 $buildlog = "$tmpdir/buildlog-$machine";
4418 $testlog = "$tmpdir/testlog-$machine";
4419 $dmesg = "$tmpdir/dmesg-$machine";
4467 … doprint "RUNNING TEST $i of $opt{NUM_TESTS}$name with option $test_type $run_type$installme\n\n";
4498 # A test may opt to not reboot the box
4570 send_email("KTEST: Your test has finished!",