Lines Matching +full:sub +full:- +full:spaces

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
581 sub run_command;
582 sub start_monitor;
583 sub end_monitor;
584 sub wait_for_monitor;
586 sub _logit {
592 sub logit {
600 sub doprint {
605 sub read_prompt {
642 sub read_yn {
648 sub read_ync {
654 sub get_mandatory_config {
685 sub show_time {
693 $time -= $hours * 3600;
697 $time -= $minutes * 60;
716 sub print_times {
752 sub get_mandatory_configs {
803 sub process_variables {
855 sub set_value {
890 sub set_eval {
906 sub set_variable {
925 sub process_compare {
951 return -1;
957 sub value_defined {
964 sub process_expression {
979 $d--;
1029 sub process_if {
1039 sub __read_config {
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;
1283 sub get_test_case {
1293 sub read_config {
1304 if ($val =~ m/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1358 exit -1;
1363 sub __eval_option {
1430 sub process_evals {
1457 sub eval_option {
1482 sub reboot {
1548 sub reboot_to_good {
1558 sub do_not_reboot {
1567 sub get_test_name() {
1578 sub dodie {
1611 my $size = $log_size - $test_log_start;
1618 my $pos = - $size;
1641 sub create_pty {
1664 sub exec_console {
1683 sub open_console {
1689 $stty_orig = `stty -g`;
1693 system("stty -icanon -echo -icrnl");
1712 sub close_console {
1728 sub start_monitor {
1740 sub end_monitor {
1742 if (--$monitor_cnt) {
1748 sub wait_for_monitor {
1791 if ($full_line =~ /Kernel panic -/) {
1799 if ($now - $start_time >= $max_monitor_wait) {
1814 sub save_logs {
1825 my $dir = "$machine-$test_type-$type-$result-$date";
1829 if (!-d $dir) {
1842 if (-f "$source") {
1851 sub fail {
1892 sub run_command {
1910 $timeout = -1; # tell wait_for_input to wait indefinitely
1942 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1967 my $delta = $end_time - $start_time;
1988 sub run_ssh {
1996 sub run_scp {
2005 sub run_scp_install {
2013 sub run_scp_mod {
2021 sub _get_grub_index {
2030 $grub_number = -1;
2049 $grub_number = -1;
2066 sub get_grub_index {
2100 sub wait_for_input {
2138 last if (defined($time) && (time - $start_time > $time));
2157 sub reboot_to {
2163 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2167 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2174 sub get_sha1 {
2177 doprint "git rev-list --max-count=1 $commit ... ";
2178 my $sha1 = `git rev-list --max-count=1 $commit`;
2195 sub monitor {
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;
2349 sub eval_kernel_version {
2357 sub do_post_install {
2368 sub test_booted {
2374 sub install {
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;
2445 sub get_version {
2449 $version = `$make -s kernelrelease | tail -1`;
2453 $version = `$make -s kernelrelease | tail -1`;
2460 sub start_monitor_and_install {
2478 sub process_warning_line {
2493 # Some compilers use UTF-8 extended for quotes and some don't.
2504 sub check_buildlog {
2511 if (-f $warnings_file) {
2547 sub check_patch_buildlog {
2550 my @files = `git show $patch | diffstat -l`;
2559 if (m,^--- a/(.*),) {
2583 sub apply_min_config {
2595 if (-f $output_config) {
2614 sub make_oldconfig {
2636 sub load_force_config {
2653 sub build {
2748 $build_time = $end_time - $start_time;
2753 sub halt {
2765 sub success {
2799 sub answer_bisect {
2809 return -1;
2816 sub child_run_test {
2828 sub child_finished {
2832 sub do_run_test {
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;
2955 sub run_git_bisect {
2985 sub bisect_reboot {
2990 # returns 1 on success, 0 on failure, -1 on skip
2991 sub run_bisect_test {
3004 return -1;
3016 return -1;
3040 sub run_bisect {
3087 sub update_bisect_replay {
3094 sub bisect {
3111 $start_files = " -- " . $start_files;
3138 if ( -f $bisect_start_file ) {
3226 sub assign_configs {
3246 sub process_config_ignore {
3252 sub get_dependencies {
3270 sub save_config {
3285 sub create_config {
3295 sub run_config_bisect_test {
3307 sub config_bisect_end {
3309 my $diffexec = "diff -u";
3311 if (-f "$builddir/scripts/diffconfig") {
3320 sub run_config_bisect {
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
3356 sub config_bisect {
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") {
3476 sub patchcheck_reboot {
3481 sub patchcheck {
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`;
3642 sub add_dep {
3661 sub read_kconfig {
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);
3750 sub read_depends {
3777 if (! -f $kconfig && $arch =~ /\d$/) {
3782 if (! -f $kconfig) {
3792 sub make_new_config {
3804 sub chomp_config {
3812 sub get_depends {
3823 my $valid = "A-Za-z_0-9";
3842 sub test_this_config {
3896 sub make_min_config {
3912 if (-f $output_minconfig && !$start_minconfig_defined) {
4139 sub make_warnings_file {
4156 # Some compilers use UTF-8 extended for quotes
4171 sub option_defined {
4181 sub __set_test_option {
4207 sub set_test_option {
4216 sub find_mailer {
4225 if (-x "$path/$mailer") {
4233 sub do_send_mail {
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";
4282 sub send_email {
4292 sub cancel_test {
4304 sub die_usage {
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,^(.*/),) {
4415 if (! -d $dir) {
4421 LOG->autoflush(1);
4477 if (!-d $outputdir) {
4515 if (!-d $tmpdir) {
4523 $buildlog = "$tmpdir/buildlog-$machine";
4524 $testlog = "$tmpdir/testlog-$machine";
4525 $dmesg = "$tmpdir/dmesg-$machine";
4692 # The following are here to standardize tabs/spaces/etc across the most likely editors