Lines Matching +full:sig +full:- +full:dir +full:- +full:cmd

1 #!/usr/bin/perl -w
2 # SPDX-License-Identifier: GPL-2.0-only
4 # Copyright 2010 - Steven Rostedt <srostedt@redhat.com>, Red Hat Inc.
69 "GRUB_REBOOT" => "grub2-reboot",
70 "GRUB_BLS_GET" => "grubby --info=ALL",
78 "LOCALVERSION" => "-test",
81 "TARGET_IMAGE" => "/boot/vmlinuz-test",
426 i.e. -j20
437 …POWER_CYCLE = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin\@power/outl…
448 CONSOLE = nc -d localhost 3001
494 kernel vmlinuz-test
499 menu must be a non-nested menu. Add the quotes used in the menu
693 $time -= $hours * 3600;
697 $time -= $minutes * 60;
951 return -1;
979 $d--;
1188 if (-f "$1/$file") {
1194 if ( ! -r $file ) {
1202 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1216 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1250 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1272 $test_num += $repeat - 1;
1304 if ($val =~ m/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1358 exit -1;
1611 my $size = $log_size - $test_log_start;
1618 my $pos = - $size;
1689 $stty_orig = `stty -g`;
1693 system("stty -icanon -echo -icrnl");
1742 if (--$monitor_cnt) {
1791 if ($full_line =~ /Kernel panic -/) {
1799 if ($now - $start_time >= $max_monitor_wait) {
1825 my $dir = "$machine-$test_type-$type-$result-$date";
1827 $dir = "$basedir/$dir";
1829 if (!-d $dir) {
1830 mkpath($dir) or
1831 dodie "can't create $dir";
1842 if (-f "$source") {
1843 cp "$source", "$dir/$name" or
1848 doprint "*** Saved info to $dir ***\n";
1910 $timeout = -1; # tell wait_for_input to wait indefinitely
1916 $pid = open(CMD, "$command 2>&1 |") or
1938 my $fp = \*CMD;
1942 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1963 close(CMD);
1967 my $delta = $end_time - $start_time;
1989 my ($cmd, $timeout) = @_;
1992 $cp_exec =~ s/\$SSH_COMMAND/$cmd/g;
2030 $grub_number = -1;
2049 $grub_number = -1;
2138 last if (defined($time) && (time - $start_time > $time));
2163 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2167 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2177 doprint "git rev-list --max-count=1 $commit ... ";
2178 my $sha1 = `git rev-list --max-count=1 $commit`;
2223 my $time = $stop_after_failure - (time - $failure_start);
2260 if ($now - $success_start >= $stop_after_success) {
2284 if ($now - $failure_start >= $stop_after_failure) {
2294 if ($full_line =~ /Kernel panic -/) {
2320 if (time - $monitor_start > $stop_test_after) {
2328 $reboot_time = $end_time - $start_time;
2334 fail "failed - got a bug report" and return 0;
2339 fail "failed - never got a boot prompt." and return 0;
2412 $install_time = $end_time - $start_time;
2420 my $modtar = "ktest-mods.tar.bz2";
2422 run_ssh "rm -rf $modlib" or
2425 # would be nice if scp -r did not follow symbolic links
2426 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2437 run_ssh "rm -f /tmp/$modtar";
2442 $install_time = $end_time - $start_time;
2449 $version = `$make -s kernelrelease | tail -1`;
2453 $version = `$make -s kernelrelease | tail -1`;
2493 # Some compilers use UTF-8 extended for quotes and some don't.
2511 if (-f $warnings_file) {
2550 my @files = `git show $patch | diffstat -l`;
2559 if (m,^--- a/(.*),) {
2595 if (-f $output_config) {
2748 $build_time = $end_time - $start_time;
2809 return -1;
2848 $SIG{CHLD} = qw(child_finished);
2872 if ($full_line =~ /Kernel panic -/) {
2895 if ($now - $failure_start >= $stop_after_failure) {
2909 $test_time = $end_time - $start_time;
2919 return -1;
2924 fail "test abort" and return -2;
2938 return -1;
2940 return -2;
2943 and return -2;
2990 # returns 1 on success, 0 on failure, -1 on skip
3004 return -1;
3016 return -1;
3111 $start_files = " -- " . $start_files;
3138 if ( -f $bisect_start_file ) {
3309 my $diffexec = "diff -u";
3311 if (-f "$builddir/scripts/diffconfig") {
3323 my $cmd;
3327 $reset = "-r";
3329 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3331 # config-bisect returns:
3335 # -1 (255) on error
3384 "$pwd/config-bisect.pl",
3385 "$dirname/config-bisect.pl",
3386 "$builddir/tools/testing/ktest/config-bisect.pl",
3391 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3394 fail "Could not find an executable config-bisect.pl\n",
3395 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3408 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3409 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3410 if (-f "$tmpdir/good_config.tmp") {
3415 if (-f "$tmpdir/bad_config.tmp") {
3515 open (IN, "git cherry -v $start $end|") or
3518 open (IN, "git log --pretty=oneline $end|") or
3547 $s = `git log --pretty=oneline $s~1..$s`;
3671 if (! -f $kconfig) {
3723 $deps =~ s/^[^a-zA-Z0-9_]*//;
3724 $deps =~ s/[^a-zA-Z0-9_]*$//;
3726 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3732 $iflevel-- if ($iflevel);
3777 if (! -f $kconfig && $arch =~ /\d$/) {
3782 if (! -f $kconfig) {
3783 doprint "No idea what arch dir $orig is for\n";
3823 my $valid = "A-Za-z_0-9";
3912 if (-f $output_minconfig && !$start_minconfig_defined) {
4156 # Some compilers use UTF-8 extended for quotes
4225 if (-x "$path/$mailer") {
4253 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4255 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4299 "Your test started at $script_start_time was cancelled: sig int");
4301 die "\nCaught Sig Int, test interrupted: $!\n"
4307 usage: ktest.pl [options] [config-file]
4309 -D value: Where value can act as an option override.
4310 -D BUILD_NOCLEAN=1
4312 -D TEST_TYPE[2]=build
4316 -D USE_TEMP_DIR:=1
4325 if ( $ARGV[0] eq "-D" ) {
4336 } elsif ( $ARGV[0] =~ m/^-D(.*)/) {
4345 } elsif ( $ARGV[0] eq "-h" ) {
4355 if (! -f $ktest_config) {
4363 if (! -f $ktest_config) {
4394 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4413 if (! -e $opt{"LOG_FILE"} && $opt{"LOG_FILE"} =~ m,^(.*/),) {
4414 my $dir = $1;
4415 if (! -d $dir) {
4416 mkpath($dir) or die "Failed to create directories '$dir': $!";
4417 print "\nThe log directory $dir did not exist, so it was created.\n";
4421 LOG->autoflush(1);
4450 $SIG{INT} = qw(cancel_test);
4477 if (!-d $outputdir) {
4515 if (!-d $tmpdir) {
4523 $buildlog = "$tmpdir/buildlog-$machine";
4524 $testlog = "$tmpdir/testlog-$machine";
4525 $dmesg = "$tmpdir/dmesg-$machine";