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;
925 return -1;
953 $d--;
1014 my ($config, $current_test_num) = @_;
1017 open($in, $config) || die "can't read file $config";
1019 my $name = $config;
1026 my $skip = 0;
1066 # If SKIP is anywhere in the line, the command will be skipped
1067 if ($rest =~ s/\s+SKIP\b//) {
1068 $skip = 1;
1071 $skip = 0;
1081 $skip = 1;
1083 $skip = 0;
1091 $skip = 1;
1099 if (!$skip) {
1113 if (!$skip && $rest !~ /^\s*$/) {
1117 if ($skip && $type eq "TEST_START") {
1127 $skip = 1;
1130 $skip = 0;
1137 $skip = 1;
1151 next if ($skip);
1160 # check the path of the config file first
1161 if ($config =~ m,(.*)/,) {
1162 if (-f "$1/$file") {
1168 if ( ! -r $file ) {
1176 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1178 next if ($skip);
1190 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1192 next if ($skip);
1224 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1225 next if ($skip);
1230 # process config variables.
1231 # Config variables are only active while reading the
1232 # config and can be defined anywhere. They also ignore
1234 # on of these sections that have SKIP defined.
1241 die "$name: $.: Garbage found in config\n$_";
1246 $test_num += $repeat - 1;
1268 my ($config) = @_;
1273 $test_case = __read_config $config, \$test_num;
1319 exit -1;
1569 my $size = $log_size - $test_log_start;
1576 my $pos = - $size;
1647 $stty_orig = `stty -g`;
1651 system("stty -icanon -echo -icrnl");
1700 if (--$monitor_cnt) {
1749 if ($full_line =~ /Kernel panic -/) {
1757 if ($now - $start_time >= $max_monitor_wait) {
1783 my $dir = "$machine-$test_type-$type-$result-$date";
1787 if (!-d $dir) {
1793 "config" => $output_config,
1800 if (-f "$source") {
1868 $timeout = -1; # tell wait_for_input to wait indefinitely
1900 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1925 my $delta = $end_time - $start_time;
1981 my ($command, $target, $skip, $submenu) = @_;
1988 $grub_number = -1;
2007 $grub_number = -1;
2008 } elsif (/$skip/) {
2028 my $skip;
2041 $skip = '^\s*title\s';
2045 $skip = '^\s*menuentry';
2050 $skip = '^title=';
2055 _get_grub_index($command, $target, $skip, $submenu);
2096 last if (defined($time) && (time - $start_time > $time));
2121 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2125 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2135 doprint "git rev-list --max-count=1 $commit ... ";
2136 my $sha1 = `git rev-list --max-count=1 $commit`;
2181 my $time = $stop_after_failure - (time - $failure_start);
2218 if ($now - $success_start >= $stop_after_success) {
2242 if ($now - $failure_start >= $stop_after_failure) {
2252 if ($full_line =~ /Kernel panic -/) {
2278 if (time - $monitor_start > $stop_test_after) {
2286 $reboot_time = $end_time - $start_time;
2292 fail "failed - got a bug report" and return 0;
2297 fail "failed - never got a boot prompt." and return 0;
2355 open(IN, "$output_config") or dodie("Can't read config file");
2370 $install_time = $end_time - $start_time;
2378 my $modtar = "ktest-mods.tar.bz2";
2380 run_ssh "rm -rf $modlib" or
2383 # would be nice if scp -r did not follow symbolic links
2384 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2395 run_ssh "rm -f /tmp/$modtar";
2400 $install_time = $end_time - $start_time;
2407 $version = `$make -s kernelrelease | tail -1`;
2446 # Some compilers use UTF-8 extended for quotes and some don't.
2466 if (-f $warnings_file) {
2502 my @files = `git show $patch | diffstat -l`;
2511 if (m,^--- a/(.*),) {
2538 # Read the config file and remove anything that
2540 # then add the force config back.
2547 if (-f $output_config) {
2558 foreach my $config (keys %force_config) {
2559 print OUT "$force_config{$config}\n";
2582 dodie "failed make config oldconfig";
2587 # read a config file and use this to force new configs.
2589 my ($config) = @_;
2591 doprint "Loading force configs from $config\n";
2592 open(IN, $config) or
2593 dodie "failed to read $config";
2596 if (/^(CONFIG[^\s=]*)(\s*=.*)/) {
2629 dodie "could not copy $1 to .config";
2634 # old config can ask questions
2643 dodie "moving .config";
2667 dodie "failed make config";
2669 # Run old config regardless, to enforce min configurations
2700 $build_time = $end_time - $start_time;
2753 doprint "Pass, fail, or skip? [p/f/s]";
2761 return -1;
2824 if ($full_line =~ /Kernel panic -/) {
2847 if ($now - $failure_start >= $stop_after_failure) {
2861 $test_time = $end_time - $start_time;
2871 return -1;
2876 fail "test abort" and return -2;
2889 } elsif ($bisect_ret_default eq "skip") {
2890 return -1;
2892 return -2;
2895 and return -2;
2942 # returns 1 on success, 0 on failure, -1 on skip
2958 return -1;
2970 return -1;
3037 return "skip";
3065 $start_files = " -- " . $start_files;
3092 if ( -f $bisect_start_file ) {
3098 print "** BISECT_REPLAY is defined in config file **";
3099 print " Ignore config option and perform new git bisect log?\n";
3181 my ($hash, $config) = @_;
3183 doprint "Reading configs from $config\n";
3185 open (IN, $config) or
3186 dodie "Failed to read $config";
3190 if (/^((CONFIG\S*)=.*)/) {
3192 } elsif (/^(# (CONFIG\S*) is not set)/) {
3201 my ($config) = @_;
3203 assign_configs \%config_ignore, $config;
3207 my ($config) = @_;
3209 my $arr = $dependency{$config};
3233 foreach my $config (keys %configs) {
3234 print OUT "$configs{$config}\n";
3242 doprint "Creating old config from $name configs\n";
3263 my $diffexec = "diff -u";
3265 if (-f "$builddir/scripts/diffconfig") {
3269 doprint "No more config bisecting possible.\n";
3281 $reset = "-r";
3283 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3285 # config-bisect returns:
3287 # 1 for finding a good config
3289 # -1 (255) on error
3296 doprint "NEW GOOD CONFIG ($pass)\n";
3299 # Return 3 for good config
3302 doprint "NEW BAD CONFIG ($pass)\n";
3305 # Return 4 for bad config
3326 doprint "No config specified, checking if defconfig works";
3329 fail "Have no good config to compare with, please set CONFIG_BISECT_GOOD";
3338 "$pwd/config-bisect.pl",
3339 "$dirname/config-bisect.pl",
3340 "$builddir/tools/testing/ktest/config-bisect.pl",
3345 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3348 fail "Could not find an executable config-bisect.pl\n",
3349 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3362 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3363 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3364 if (-f "$tmpdir/good_config.tmp") {
3369 if (-f "$tmpdir/bad_config.tmp") {
3380 system("cp $output_config $good_config") == 0 or dodie "cp good config";
3386 system("cp $output_config $bad_config") == 0 or dodie "cp bad config";
3390 doprint "Testing bad config\n";
3394 fail "Bad config succeeded when expected to fail!";
3399 doprint "Testing good config\n";
3403 fail "Good config failed when expected to succeed!";
3469 open (IN, "git cherry -v $start $end|") or
3472 open (IN, "git log --pretty=oneline $end|") or
3531 # ?? no config to use?
3566 # $config depends on $dep
3567 my ($config, $dep) = @_;
3569 if (defined($depends{$config})) {
3570 $depends{$config} .= " " . $dep;
3572 $depends{$config} = $dep;
3588 my $config;
3594 if (! -f $kconfig) {
3623 if (/^\s*(menu)?config\s+(\S+)\s*$/) {
3625 $config = $2;
3628 add_dep $config, $ifdeps[$i];
3631 # collect the depends for the config
3634 add_dep $config, $1;
3636 # Get the configs that select this config
3639 # selected by depends on config
3640 add_dep $1, $config;
3646 $deps =~ s/^[^a-zA-Z0-9_]*//;
3647 $deps =~ s/[^a-zA-Z0-9_]*$//;
3649 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3655 $iflevel-- if ($iflevel);
3687 doprint "Could not find arch from config file\n";
3700 if (! -f $kconfig && $arch =~ /\d$/) {
3705 if (! -f $kconfig) {
3721 foreach my $config (@configs) {
3722 print OUT "$config\n";
3728 my ($config) = @_;
3730 $config =~ s/CONFIG_//;
3732 return $config;
3746 my $valid = "A-Za-z_0-9";
3766 my ($config) = @_;
3770 # if we already processed this config, skip it
3771 if (defined($processed_configs{$config})) {
3774 $processed_configs{$config} = 1;
3776 # if this config failed during this round, skip it
3777 if (defined($nochange_config{$config})) {
3781 my $kconfig = chomp_config $config;
3785 my @parents = get_depends $config;
3787 # if the parent is in the min config, check it first
3796 # Remove this config from the list of configs
3798 # .config to make sure it is missing the config that
3801 $configs{$config} = "# $config is not set";
3804 delete $configs{$config};
3808 if (!defined($configs{$config}) || $configs{$config} =~ /^#/) {
3809 return $config;
3812 doprint "disabling config $config did not change .config\n";
3814 $nochange_config{$config} = 1;
3835 if (-f $output_minconfig && !$start_minconfig_defined) {
3888 foreach my $config (@config_keys) {
3889 my $kconfig = chomp_config $config;
3897 foreach my $config (@config_keys) {
3899 if (defined($keep_configs{$config})) {
3902 doprint "$config set by $file ... ignored\n";
3903 delete $min_configs{$config};
3906 # But make sure the settings are the same. If a min config
3910 if (defined($config_ignore{$config})) {
3911 if ($config_ignore{$config} ne $min_configs{$config}) {
3912 doprint "$config is in allnoconfig as '$config_ignore{$config}'";
3913 doprint " but it is '$min_configs{$config}' in minconfig .. keeping\n";
3914 $keep_configs{$config} = $min_configs{$config};
3916 doprint "$config set by allnoconfig ... ignored\n";
3918 delete $min_configs{$config};
3926 my $config;
3929 # Now disable each config one by one and do a make oldconfig
3930 # till we find a config that changes our list.
3938 # Put configs that did not modify the config at the end.
3945 # This config didn't change the .config last time.
3947 my $config = shift @test_configs;
3948 push @test_configs, $config;
3951 # if every test config has failed to modify the .config file
3959 foreach my $config (@test_configs) {
3961 $found = test_this_config $config;
3965 # oh well, try another config
3982 $config = $found;
3984 doprint "Test with $config disabled\n";
4004 doprint "$min_configs{$config} is needed to boot the box... keeping\n";
4005 # this config is needed, add it to the ignore list.
4006 $keep_configs{$config} = $min_configs{$config};
4007 $save_configs{$config} = $min_configs{$config};
4008 delete $min_configs{$config};
4014 foreach my $config (keys %save_configs) {
4015 print OUT "$save_configs{$config}\n";
4023 # We booted without this config, remove it from the minconfigs.
4024 doprint "$config is not needed, disabling\n";
4026 delete $min_configs{$config};
4028 # Also disable anything that is not enabled in this config
4032 foreach my $config (@config_keys) {
4033 if (!defined($configs{$config})) {
4034 doprint "$config is not set, disabling\n";
4035 delete $min_configs{$config};
4042 foreach my $config (keys %keep_configs) {
4043 print OUT "$keep_configs{$config}\n";
4045 foreach my $config (keys %min_configs) {
4046 print OUT "$min_configs{$config}\n";
4079 # Some compilers use UTF-8 extended for quotes
4148 if (-x "$path/$mailer") {
4176 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4178 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4208 doprint "No email sent: email or mailer not specified in config.\n";
4227 $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
4231 if (! -f $ktest_config) {
4239 if (! -f $ktest_config) {
4251 # the config file. It is best to use this variable when assigning other
4258 # The config options below it will override the defaults
4270 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4273 # Append any configs entered in manually to the config file.
4278 foreach my $config (@new_configs) {
4279 print OUT "$config = $entered_configs{$config}\n";
4280 $opt{$config} = process_variables($entered_configs{$config});
4289 LOG->autoflush(1);
4345 if (!-d $outputdir) {
4383 if (!-d $tmpdir) {
4391 $buildlog = "$tmpdir/buildlog-$machine";
4392 $testlog = "$tmpdir/testlog-$machine";
4393 $dmesg = "$tmpdir/dmesg-$machine";
4394 $output_config = "$outputdir/.config";
4421 # mistake in config file?
4461 dodie "Failed to create temp config";