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 <srostedt@redhat.com>, Red Hat Inc.
67 "GRUB_REBOOT" => "grub2-reboot",
68 "GRUB_BLS_GET" => "grubby --info=ALL",
76 "LOCALVERSION" => "-test",
79 "TARGET_IMAGE" => "/boot/vmlinuz-test",
239 # set when a test is something other that just building or install
301 "TEST" => \$run_test,
389 The machine hostname that you will test.
418 i.e. -j20
422 The place to put your image on the test machine.
429 …POWER_CYCLE = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin\@power/outl…
440 CONSOLE = nc -d localhost 3001
447 Required version ending to differentiate the test
452 Way to reboot the box to the test kernel.
462 The test will not modify that file.
472 SYSLINUX_LABEL to define the label to boot to for the test kernel.
476 The grub title name for the test kernel to boot
480 manually add an option for the test. ktest.pl will search
484 For example, if in the /boot/grub/menu.lst the test kernel title has:
485 title Test Kernel
486 kernel vmlinuz-test
487 GRUB_MENU = Test Kernel
491 menu must be a non-nested menu. Add the quotes used in the menu
510 A script to reboot the target into the test kernel
622 $time -= $hours * 3600;
626 $time -= $minutes * 60;
663 doprint "Test time: ";
771 if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ &&
776 # Note if a test is something other than build, then we
853 return -1;
882 $d--;
1093 if (-f "$1/$file") {
1099 if ( ! -r $file ) {
1107 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1121 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1155 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1177 $test_num += $repeat - 1;
1189 print "What test case would you like to run?\n";
1209 # was a test specified?
1211 print "No test case specified.\n";
1232 # remove per test labels.
1250 exit -1;
1264 foreach my $test (keys %repeat_tests) {
1265 if ($i >= $test &&
1266 $i < $test + $repeat_tests{$test}) {
1269 $parent = $test;
1283 # otherwise see if the default OPT (without [$i]) exists.
1380 # test if the machine can be connected to within a few seconds
1481 doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n";
1507 $log_size -= $test_log_start;
1510 $pos = - $mail_max_size;
1523 send_email("KTEST: critical failure for test $i [$name]",
1524 "Your test started at $script_start_time has failed with:\n@_\n", $log_file);
1587 $stty_orig = `stty -g`;
1590 # a time without having to wait for a newline
1591 system("stty -icanon -echo -icrnl");
1640 if (--$monitor_cnt) {
1689 if ($full_line =~ /Kernel panic -/) {
1697 if ($now - $start_time >= $max_monitor_wait) {
1723 my $dir = "$machine-$test_type-$type-$result-$date";
1727 if (!-d $dir) {
1740 if (-f "$source") {
1775 doprint "KTEST RESULT: TEST $i$name Failed: ", @_, "\n";
1835 if (defined($timeout) && (($now - $start_time) >= $timeout)) {
1860 my $delta = $end_time - $start_time;
1923 $grub_number = -1;
2017 last if (defined($time) && (time - $start_time > $time));
2042 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2046 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2056 doprint "git rev-list --max-count=1 $commit ... ";
2057 my $sha1 = `git rev-list --max-count=1 $commit`;
2103 my $time = $stop_after_failure - (time - $failure_start);
2107 doprint "Test forced to stop after $stop_after_failure seconds after failure\n";
2140 if ($now - $success_start >= $stop_after_success) {
2141 doprint "Test forced to stop after $stop_after_success seconds after success\n";
2164 if ($now - $failure_start >= $stop_after_failure) {
2165 doprint "Test forced to stop after $stop_after_failure seconds after failure\n";
2174 if ($full_line =~ /Kernel panic -/) {
2200 if (time - $monitor_start > $stop_test_after) {
2208 $reboot_time = $end_time - $start_time;
2214 fail "failed - got a bug report" and return 0;
2219 fail "failed - never got a boot prompt." and return 0;
2246 # Sometimes the reboot fails, and will hang. We try to ssh to the box
2292 $install_time = $end_time - $start_time;
2300 my $modtar = "ktest-mods.tar.bz2";
2302 run_ssh "rm -rf $modlib" or
2305 # would be nice if scp -r did not follow symbolic links
2306 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2314 run_ssh "'(cd / && tar xjf /tmp/$modtar)'" or
2317 run_ssh "rm -f /tmp/$modtar";
2322 $install_time = $end_time - $start_time;
2329 $version = `$make -s kernelrelease | tail -1`;
2371 # Some compilers use UTF-8 extended for quotes and some don't.
2391 if (-f $warnings_file) {
2427 my @files = `git show $patch | diffstat -l`;
2436 if (m,^--- a/(.*),) {
2472 if (-f $output_config) {
2623 $build_time = $end_time - $start_time;
2655 doprint "KTEST RESULT: TEST $i$name SUCCESS!!!! **\n";
2683 return -1;
2720 doprint "run test $run_test\n";
2748 if ($full_line =~ /Kernel panic -/) {
2771 if ($now - $failure_start >= $stop_after_failure) {
2785 $test_time = $end_time - $start_time;
2795 return -1;
2800 fail "test abort" and return -2;
2814 return -1;
2816 return -2;
2819 and return -2;
2826 fail "test failed" and return 0;
2866 # returns 1 on success, 0 on failure, -1 on skip
2882 return -1;
2894 return -1;
2989 $start_files = " -- " . $start_files;
3005 # Can't have a test without having a test to run
3006 if ($type eq "test" && !defined($run_test)) {
3016 if ( -f $bisect_start_file ) {
3089 my $test;
3092 $test = run_git_bisect "git bisect $result";
3094 } while ($test);
3212 my $diffexec = "diff -u";
3214 if (-f "$builddir/scripts/diffconfig") {
3232 $reset = "-r";
3234 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3236 # config-bisect returns:
3240 # -1 (255) on error
3288 my @locations = ( "$pwd/config-bisect.pl",
3289 "$dirname/config-bisect.pl",
3290 "$builddir/tools/testing/ktest/config-bisect.pl",
3295 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3298 fail "Could not find an executable config-bisect.pl\n",
3299 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3305 doprint "Disabling 'MIN_CONFIG' for this test\n";
3312 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3313 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3314 if (-f "$tmpdir/good_config.tmp") {
3319 if (-f "$tmpdir/bad_config.tmp") {
3413 # Can't have a test without having a test to run
3414 if ($type eq "test" && !defined($run_test)) {
3419 open (IN, "git cherry -v $start $end|") or
3422 open (IN, "git log --pretty=oneline $end|") or
3446 doprint("Going to test the following commits:\n");
3553 if (! -f $kconfig) {
3605 $deps =~ s/^[^a-zA-Z0-9_]*//;
3606 $deps =~ s/[^a-zA-Z0-9_]*$//;
3608 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3614 $iflevel-- if ($iflevel);
3659 if (! -f $kconfig && $arch =~ /\d$/) {
3664 if (! -f $kconfig) {
3705 my $valid = "A-Za-z_0-9";
3749 # Test dependencies first
3788 if ($type ne "boot" && $type ne "test") {
3790 " make_min_config works only with 'boot' and 'test'\n" and return;
3800 if (-f $output_minconfig && !$start_minconfig_defined) {
3917 # if every test config has failed to modify the .config file
3950 doprint "Test with $config disabled\n";
3960 if ($type eq "test" && !$failed) {
3989 # We booted without this config, remove it from the minconfigs.
4032 dodie "Must define WARNINGS_FILE for make_warnings_file test";
4036 dodie "BUILD_TYPE can not be 'nobuild' for make_warnings_file test";
4046 # Some compilers use UTF-8 extended for quotes
4061 $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
4065 if (! -f $ktest_config) {
4073 if (! -f $ktest_config) {
4087 # move the test cases to other locations or to other machines.
4091 # Define each test with TEST_START
4104 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4123 LOG->autoflush(1);
4172 foreach my $test (keys %repeat_tests) {
4173 if ($i >= $test &&
4174 $i < $test + $repeat_tests{$test}) {
4175 $option = "$name\[$test\]";
4207 if (-x "$path/$mailer") {
4235 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4237 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4273 send_email("KTEST: Your [$name] test was cancelled",
4274 "Your test started at $script_start_time was cancelled: sig int");
4276 die "\nCaught Sig Int, test interrupted: $!\n"
4284 # Do not reboot on failing test options
4306 if (!-d $outputdir) {
4320 # The first test may override the PRE_KTEST option
4328 send_email("KTEST: Your [$name] test was started",
4329 "Your test was started on $script_start_time");
4333 # Any test can override the POST_KTEST option
4334 # The last test takes precedence.
4344 if (!-d $tmpdir) {
4352 $buildlog = "$tmpdir/buildlog-$machine";
4353 $testlog = "$tmpdir/testlog-$machine";
4354 $dmesg = "$tmpdir/dmesg-$machine";
4402 … doprint "RUNNING TEST $i of $opt{NUM_TESTS}$name with option $test_type $run_type$installme\n\n";
4433 # A test may opt to not reboot the box
4506 send_email("KTEST: Your test has finished!",