Lines Matching +full:skip +full:- +full:config
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",
247 # set when creating a new config
255 # in a .config file. The MIN_CONFIG and ADD_CONFIG configs.
258 # do not force reboots on config problems
420 i.e. -j20
431 …POWER_CYCLE = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin\@power/outl…
442 CONSOLE = nc -d localhost 3001
488 kernel vmlinuz-test
493 menu must be a non-nested menu. Add the quotes used in the menu
531 # a good config and we will ignore these configs for the rest
532 # of a config bisect. These configs stay as they were.
538 # config_off holds the set of configs that the bad config had disabled.
539 # We need to record them and set them in the .config when running
649 my ($config) = @_;
652 return if (defined($opt{$config}));
654 if (defined($config_help{$config})) {
656 print $config_help{$config};
660 print "$config = ";
661 if (defined($default{$config}) && length($default{$config})) {
662 print "\[$default{$config}\] ";
667 if ($default{$config}) {
668 $ans = $default{$config};
674 $entered_configs{$config} = ${ans};
687 $time -= $hours * 3600;
691 $time -= $minutes * 60;
926 return -1;
954 $d--;
1015 my ($config, $current_test_num) = @_;
1018 open($in, $config) || die "can't read file $config";
1020 my $name = $config;
1027 my $skip = 0;
1067 # If SKIP is anywhere in the line, the command will be skipped
1068 if ($rest =~ s/\s+SKIP\b//) {
1069 $skip = 1;
1072 $skip = 0;
1082 $skip = 1;
1084 $skip = 0;
1092 $skip = 1;
1100 if (!$skip) {
1114 if (!$skip && $rest !~ /^\s*$/) {
1118 if ($skip && $type eq "TEST_START") {
1128 $skip = 1;
1131 $skip = 0;
1138 $skip = 1;
1152 next if ($skip);
1161 # check the path of the config file first
1162 if ($config =~ m,(.*)/,) {
1163 if (-f "$1/$file") {
1169 if ( ! -r $file ) {
1177 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1179 next if ($skip);
1191 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1193 next if ($skip);
1225 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1226 next if ($skip);
1231 # process config variables.
1232 # Config variables are only active while reading the
1233 # config and can be defined anywhere. They also ignore
1235 # on of these sections that have SKIP defined.
1242 die "$name: $.: Garbage found in config\n$_";
1247 $test_num += $repeat - 1;
1269 my ($config) = @_;
1274 $test_case = __read_config $config, \$test_num;
1320 exit -1;
1570 my $size = $log_size - $test_log_start;
1577 my $pos = - $size;
1648 $stty_orig = `stty -g`;
1652 system("stty -icanon -echo -icrnl");
1701 if (--$monitor_cnt) {
1750 if ($full_line =~ /Kernel panic -/) {
1758 if ($now - $start_time >= $max_monitor_wait) {
1784 my $dir = "$machine-$test_type-$type-$result-$date";
1788 if (!-d $dir) {
1794 "config" => $output_config,
1801 if (-f "$source") {
1869 $timeout = -1; # tell wait_for_input to wait indefinitely
1901 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1926 my $delta = $end_time - $start_time;
1982 my ($command, $target, $skip, $submenu) = @_;
1989 $grub_number = -1;
2008 $grub_number = -1;
2009 } elsif (/$skip/) {
2029 my $skip;
2042 $skip = '^\s*title\s';
2046 $skip = '^\s*menuentry\s';
2051 $skip = '^title=';
2056 _get_grub_index($command, $target, $skip, $submenu);
2097 last if (defined($time) && (time - $start_time > $time));
2122 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2126 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2136 doprint "git rev-list --max-count=1 $commit ... ";
2137 my $sha1 = `git rev-list --max-count=1 $commit`;
2182 my $time = $stop_after_failure - (time - $failure_start);
2219 if ($now - $success_start >= $stop_after_success) {
2243 if ($now - $failure_start >= $stop_after_failure) {
2253 if ($full_line =~ /Kernel panic -/) {
2279 if (time - $monitor_start > $stop_test_after) {
2287 $reboot_time = $end_time - $start_time;
2293 fail "failed - got a bug report" and return 0;
2298 fail "failed - never got a boot prompt." and return 0;
2356 open(IN, "$output_config") or dodie("Can't read config file");
2371 $install_time = $end_time - $start_time;
2379 my $modtar = "ktest-mods.tar.bz2";
2381 run_ssh "rm -rf $modlib" or
2384 # would be nice if scp -r did not follow symbolic links
2385 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2396 run_ssh "rm -f /tmp/$modtar";
2401 $install_time = $end_time - $start_time;
2408 $version = `$make -s kernelrelease | tail -1`;
2412 $version = `$make -s kernelrelease | tail -1`;
2452 # Some compilers use UTF-8 extended for quotes and some don't.
2472 if (-f $warnings_file) {
2508 my @files = `git show $patch | diffstat -l`;
2517 if (m,^--- a/(.*),) {
2544 # Read the config file and remove anything that
2546 # then add the force config back.
2553 if (-f $output_config) {
2564 foreach my $config (keys %force_config) {
2565 print OUT "$force_config{$config}\n";
2588 dodie "failed make config oldconfig";
2593 # read a config file and use this to force new configs.
2595 my ($config) = @_;
2597 doprint "Loading force configs from $config\n";
2598 open(IN, $config) or
2599 dodie "failed to read $config";
2602 if (/^(CONFIG[^\s=]*)(\s*=.*)/) {
2635 dodie "could not copy $1 to .config";
2640 # old config can ask questions
2649 dodie "moving .config";
2673 dodie "failed make config";
2675 # Run old config regardless, to enforce min configurations
2706 $build_time = $end_time - $start_time;
2759 doprint "Pass, fail, or skip? [p/f/s]";
2767 return -1;
2830 if ($full_line =~ /Kernel panic -/) {
2853 if ($now - $failure_start >= $stop_after_failure) {
2867 $test_time = $end_time - $start_time;
2877 return -1;
2882 fail "test abort" and return -2;
2895 } elsif ($bisect_ret_default eq "skip") {
2896 return -1;
2898 return -2;
2901 and return -2;
2948 # returns 1 on success, 0 on failure, -1 on skip
2962 return -1;
2974 return -1;
3041 return "skip";
3069 $start_files = " -- " . $start_files;
3096 if ( -f $bisect_start_file ) {
3102 print "** BISECT_REPLAY is defined in config file **";
3103 print " Ignore config option and perform new git bisect log?\n";
3185 my ($hash, $config) = @_;
3187 doprint "Reading configs from $config\n";
3189 open (IN, $config) or
3190 dodie "Failed to read $config";
3194 if (/^((CONFIG\S*)=.*)/) {
3196 } elsif (/^(# (CONFIG\S*) is not set)/) {
3205 my ($config) = @_;
3207 assign_configs \%config_ignore, $config;
3211 my ($config) = @_;
3213 my $arr = $dependency{$config};
3237 foreach my $config (keys %configs) {
3238 print OUT "$configs{$config}\n";
3246 doprint "Creating old config from $name configs\n";
3267 my $diffexec = "diff -u";
3269 if (-f "$builddir/scripts/diffconfig") {
3273 doprint "No more config bisecting possible.\n";
3285 $reset = "-r";
3287 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3289 # config-bisect returns:
3291 # 1 for finding a good config
3293 # -1 (255) on error
3300 doprint "NEW GOOD CONFIG ($pass)\n";
3303 # Return 3 for good config
3306 doprint "NEW BAD CONFIG ($pass)\n";
3309 # Return 4 for bad config
3330 doprint "No config specified, checking if defconfig works";
3333 fail "Have no good config to compare with, please set CONFIG_BISECT_GOOD";
3342 "$pwd/config-bisect.pl",
3343 "$dirname/config-bisect.pl",
3344 "$builddir/tools/testing/ktest/config-bisect.pl",
3349 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3352 fail "Could not find an executable config-bisect.pl\n",
3353 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3366 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3367 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3368 if (-f "$tmpdir/good_config.tmp") {
3373 if (-f "$tmpdir/bad_config.tmp") {
3384 system("cp $output_config $good_config") == 0 or dodie "cp good config";
3390 system("cp $output_config $bad_config") == 0 or dodie "cp bad config";
3394 doprint "Testing bad config\n";
3398 fail "Bad config succeeded when expected to fail!";
3403 doprint "Testing good config\n";
3407 fail "Good config failed when expected to succeed!";
3473 open (IN, "git cherry -v $start $end|") or
3476 open (IN, "git log --pretty=oneline $end|") or
3535 # ?? no config to use?
3570 # $config depends on $dep
3571 my ($config, $dep) = @_;
3573 if (defined($depends{$config})) {
3574 $depends{$config} .= " " . $dep;
3576 $depends{$config} = $dep;
3592 my $config;
3598 if (! -f $kconfig) {
3627 if (/^\s*(menu)?config\s+(\S+)\s*$/) {
3629 $config = $2;
3632 add_dep $config, $ifdeps[$i];
3635 # collect the depends for the config
3638 add_dep $config, $1;
3640 # Get the configs that select this config
3643 # selected by depends on config
3644 add_dep $1, $config;
3650 $deps =~ s/^[^a-zA-Z0-9_]*//;
3651 $deps =~ s/[^a-zA-Z0-9_]*$//;
3653 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3659 $iflevel-- if ($iflevel);
3691 doprint "Could not find arch from config file\n";
3704 if (! -f $kconfig && $arch =~ /\d$/) {
3709 if (! -f $kconfig) {
3725 foreach my $config (@configs) {
3726 print OUT "$config\n";
3732 my ($config) = @_;
3734 $config =~ s/CONFIG_//;
3736 return $config;
3750 my $valid = "A-Za-z_0-9";
3770 my ($config) = @_;
3774 # if we already processed this config, skip it
3775 if (defined($processed_configs{$config})) {
3778 $processed_configs{$config} = 1;
3780 # if this config failed during this round, skip it
3781 if (defined($nochange_config{$config})) {
3785 my $kconfig = chomp_config $config;
3789 my @parents = get_depends $config;
3791 # if the parent is in the min config, check it first
3800 # Remove this config from the list of configs
3802 # .config to make sure it is missing the config that
3805 $configs{$config} = "# $config is not set";
3808 delete $configs{$config};
3812 if (!defined($configs{$config}) || $configs{$config} =~ /^#/) {
3813 return $config;
3816 doprint "disabling config $config did not change .config\n";
3818 $nochange_config{$config} = 1;
3839 if (-f $output_minconfig && !$start_minconfig_defined) {
3892 foreach my $config (@config_keys) {
3893 my $kconfig = chomp_config $config;
3901 foreach my $config (@config_keys) {
3903 if (defined($keep_configs{$config})) {
3906 doprint "$config set by $file ... ignored\n";
3907 delete $min_configs{$config};
3910 # But make sure the settings are the same. If a min config
3914 if (defined($config_ignore{$config})) {
3915 if ($config_ignore{$config} ne $min_configs{$config}) {
3916 doprint "$config is in allnoconfig as '$config_ignore{$config}'";
3917 doprint " but it is '$min_configs{$config}' in minconfig .. keeping\n";
3918 $keep_configs{$config} = $min_configs{$config};
3920 doprint "$config set by allnoconfig ... ignored\n";
3922 delete $min_configs{$config};
3930 my $config;
3933 # Now disable each config one by one and do a make oldconfig
3934 # till we find a config that changes our list.
3942 # Put configs that did not modify the config at the end.
3949 # This config didn't change the .config last time.
3951 my $config = shift @test_configs;
3952 push @test_configs, $config;
3955 # if every test config has failed to modify the .config file
3963 foreach my $config (@test_configs) {
3965 $found = test_this_config $config;
3969 # oh well, try another config
3986 $config = $found;
3988 doprint "Test with $config disabled\n";
4008 doprint "$min_configs{$config} is needed to boot the box... keeping\n";
4009 # this config is needed, add it to the ignore list.
4010 $keep_configs{$config} = $min_configs{$config};
4011 $save_configs{$config} = $min_configs{$config};
4012 delete $min_configs{$config};
4018 foreach my $config (keys %save_configs) {
4019 print OUT "$save_configs{$config}\n";
4027 # We booted without this config, remove it from the minconfigs.
4028 doprint "$config is not needed, disabling\n";
4030 delete $min_configs{$config};
4032 # Also disable anything that is not enabled in this config
4036 foreach my $config (@config_keys) {
4037 if (!defined($configs{$config})) {
4038 doprint "$config is not set, disabling\n";
4039 delete $min_configs{$config};
4046 foreach my $config (keys %keep_configs) {
4047 print OUT "$keep_configs{$config}\n";
4049 foreach my $config (keys %min_configs) {
4050 print OUT "$min_configs{$config}\n";
4083 # Some compilers use UTF-8 extended for quotes
4152 if (-x "$path/$mailer") {
4180 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4182 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4212 doprint "No email sent: email or mailer not specified in config.\n";
4231 $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
4235 if (! -f $ktest_config) {
4243 if (! -f $ktest_config) {
4255 # the config file. It is best to use this variable when assigning other
4262 # The config options below it will override the defaults
4274 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4277 # Append any configs entered in manually to the config file.
4282 foreach my $config (@new_configs) {
4283 print OUT "$config = $entered_configs{$config}\n";
4284 $opt{$config} = process_variables($entered_configs{$config});
4293 if (! -e $opt{"LOG_FILE"} && $opt{"LOG_FILE"} =~ m,^(.*/),) {
4295 if (! -d $dir) {
4301 LOG->autoflush(1);
4357 if (!-d $outputdir) {
4395 if (!-d $tmpdir) {
4403 $buildlog = "$tmpdir/buildlog-$machine";
4404 $testlog = "$tmpdir/testlog-$machine";
4405 $dmesg = "$tmpdir/dmesg-$machine";
4406 $output_config = "$outputdir/.config";
4433 # mistake in config file?
4473 dodie "Failed to create temp config";