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
586 my ($config) = @_;
589 return if (defined($opt{$config}));
591 if (defined($config_help{$config})) {
593 print $config_help{$config};
597 print "$config = ";
598 if (defined($default{$config}) && length($default{$config})) {
599 print "\[$default{$config}\] ";
604 if ($default{$config}) {
605 $ans = $default{$config};
611 $entered_configs{$config} = ${ans};
624 $time -= $hours * 3600;
628 $time -= $minutes * 60;
855 return -1;
884 $d--;
945 my ($config, $current_test_num) = @_;
948 open($in, $config) || die "can't read file $config";
950 my $name = $config;
957 my $skip = 0;
998 # If SKIP is anywhere in the line, the command will be skipped
999 if ($rest =~ s/\s+SKIP\b//) {
1000 $skip = 1;
1003 $skip = 0;
1013 $skip = 1;
1015 $skip = 0;
1023 $skip = 1;
1031 if (!$skip) {
1045 if (!$skip && $rest !~ /^\s*$/) {
1049 if ($skip && $type eq "TEST_START") {
1060 $skip = 1;
1063 $skip = 0;
1070 $skip = 1;
1084 next if ($skip);
1093 # check the path of the config file first
1094 if ($config =~ m,(.*)/,) {
1095 if (-f "$1/$file") {
1101 if ( ! -r $file ) {
1109 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=~\s*(.*?)\s*$/) {
1111 next if ($skip);
1123 } elsif (/^\s*([A-Z_\[\]\d]+)\s*=\s*(.*?)\s*$/) {
1125 next if ($skip);
1157 } elsif (/^\s*([A-Z_\[\]\d]+)\s*:=\s*(.*?)\s*$/) {
1158 next if ($skip);
1163 # process config variables.
1164 # Config variables are only active while reading the
1165 # config and can be defined anywhere. They also ignore
1167 # on of these sections that have SKIP defined.
1174 die "$name: $.: Garbage found in config\n$_";
1179 $test_num += $repeat - 1;
1201 my ($config) = @_;
1206 $test_case = __read_config $config, \$test_num;
1252 exit -1;
1507 my $size = $log_size - $test_log_start;
1514 my $pos = - $size;
1589 $stty_orig = `stty -g`;
1593 system("stty -icanon -echo -icrnl");
1642 if (--$monitor_cnt) {
1691 if ($full_line =~ /Kernel panic -/) {
1699 if ($now - $start_time >= $max_monitor_wait) {
1725 my $dir = "$machine-$test_type-$type-$result-$date";
1729 if (!-d $dir) {
1735 "config" => $output_config,
1742 if (-f "$source") {
1810 $timeout = -1; # tell wait_for_input to wait indefinitely
1842 if ($timeout >= 0 && (($now - $start_time) >= $timeout)) {
1867 my $delta = $end_time - $start_time;
1923 my ($command, $target, $skip, $submenu) = @_;
1930 $grub_number = -1;
1949 $grub_number = -1;
1950 } elsif (/$skip/) {
1970 my $skip;
1983 $skip = '^\s*title\s';
1987 $skip = '^\s*menuentry';
1992 $skip = '^title=';
1997 _get_grub_index($command, $target, $skip, $submenu);
2039 last if (defined($time) && (time - $start_time > $time));
2064 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
2068 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";
2078 doprint "git rev-list --max-count=1 $commit ... ";
2079 my $sha1 = `git rev-list --max-count=1 $commit`;
2125 my $time = $stop_after_failure - (time - $failure_start);
2162 if ($now - $success_start >= $stop_after_success) {
2186 if ($now - $failure_start >= $stop_after_failure) {
2196 if ($full_line =~ /Kernel panic -/) {
2222 if (time - $monitor_start > $stop_test_after) {
2230 $reboot_time = $end_time - $start_time;
2236 fail "failed - got a bug report" and return 0;
2241 fail "failed - never got a boot prompt." and return 0;
2299 open(IN, "$output_config") or dodie("Can't read config file");
2314 $install_time = $end_time - $start_time;
2322 my $modtar = "ktest-mods.tar.bz2";
2324 run_ssh "rm -rf $modlib" or
2327 # would be nice if scp -r did not follow symbolic links
2328 run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
2339 run_ssh "rm -f /tmp/$modtar";
2344 $install_time = $end_time - $start_time;
2351 $version = `$make -s kernelrelease | tail -1`;
2393 # Some compilers use UTF-8 extended for quotes and some don't.
2413 if (-f $warnings_file) {
2449 my @files = `git show $patch | diffstat -l`;
2458 if (m,^--- a/(.*),) {
2485 # Read the config file and remove anything that
2487 # then add the force config back.
2494 if (-f $output_config) {
2505 foreach my $config (keys %force_config) {
2506 print OUT "$force_config{$config}\n";
2529 dodie "failed make config oldconfig";
2534 # read a config file and use this to force new configs.
2536 my ($config) = @_;
2538 doprint "Loading force configs from $config\n";
2539 open(IN, $config) or
2540 dodie "failed to read $config";
2543 if (/^(CONFIG[^\s=]*)(\s*=.*)/) {
2576 dodie "could not copy $1 to .config";
2581 # old config can ask questions
2590 dodie "moving .config";
2615 dodie "failed make config";
2617 # Run old config regardless, to enforce min configurations
2645 $build_time = $end_time - $start_time;
2697 doprint "Pass, fail, or skip? [p/f/s]";
2705 return -1;
2770 if ($full_line =~ /Kernel panic -/) {
2793 if ($now - $failure_start >= $stop_after_failure) {
2807 $test_time = $end_time - $start_time;
2817 return -1;
2822 fail "test abort" and return -2;
2835 } elsif ($bisect_ret_default eq "skip") {
2836 return -1;
2838 return -2;
2841 and return -2;
2888 # returns 1 on success, 0 on failure, -1 on skip
2904 return -1;
2916 return -1;
2983 return "skip";
3011 $start_files = " -- " . $start_files;
3038 if ( -f $bisect_start_file ) {
3044 print "** BISECT_REPLAY is defined in config file **";
3045 print " Ignore config option and perform new git bisect log?\n";
3130 # a good config and we will ignore these configs for the rest
3131 # of a config bisect. These configs stay as they were.
3137 # config_off holds the set of configs that the bad config had disabled.
3138 # We need to record them and set them in the .config when running
3152 my ($hash, $config) = @_;
3154 doprint "Reading configs from $config\n";
3156 open (IN, $config)
3157 or dodie "Failed to read $config";
3161 if (/^((CONFIG\S*)=.*)/) {
3163 } elsif (/^(# (CONFIG\S*) is not set)/) {
3172 my ($config) = @_;
3174 assign_configs \%config_ignore, $config;
3178 my ($config) = @_;
3180 my $arr = $dependency{$config};
3204 foreach my $config (keys %configs) {
3205 print OUT "$configs{$config}\n";
3213 doprint "Creating old config from $name configs\n";
3234 my $diffexec = "diff -u";
3236 if (-f "$builddir/scripts/diffconfig") {
3240 doprint "No more config bisecting possible.\n";
3254 $reset = "-r";
3256 run_command "$config_bisect_exec $reset -b $outputdir $good $bad $last_result", 1;
3258 # config-bisect returns:
3260 # 1 for finding a good config
3262 # -1 (255) on error
3269 doprint "NEW GOOD CONFIG ($pass)\n";
3272 # Return 3 for good config
3275 doprint "NEW BAD CONFIG ($pass)\n";
3278 # Return 4 for bad config
3299 doprint "No config specified, checking if defconfig works";
3302 fail "Have no good config to compare with, please set CONFIG_BISECT_GOOD";
3310 my @locations = ( "$pwd/config-bisect.pl",
3311 "$dirname/config-bisect.pl",
3312 "$builddir/tools/testing/ktest/config-bisect.pl",
3317 last if (defined($config_bisect_exec && -x $config_bisect_exec));
3320 fail "Could not find an executable config-bisect.pl\n",
3321 " Set CONFIG_BISECT_EXEC to point to config-bisect.pl";
3334 if (-f "$tmpdir/good_config.tmp" || -f "$tmpdir/bad_config.tmp") {
3335 if (read_yn "Interrupted config-bisect. Continue (n - will start new)?") {
3336 if (-f "$tmpdir/good_config.tmp") {
3341 if (-f "$tmpdir/bad_config.tmp") {
3352 system("cp $output_config $good_config") == 0 or dodie "cp good config";
3358 system("cp $output_config $bad_config") == 0 or dodie "cp bad config";
3362 doprint "Testing bad config\n";
3366 fail "Bad config succeeded when expected to fail!";
3371 doprint "Testing good config\n";
3375 fail "Good config failed when expected to succeed!";
3441 open (IN, "git cherry -v $start $end|") or
3444 open (IN, "git log --pretty=oneline $end|") or
3503 # ?? no config to use?
3546 # $config depends on $dep
3547 my ($config, $dep) = @_;
3549 if (defined($depends{$config})) {
3550 $depends{$config} .= " " . $dep;
3552 $depends{$config} = $dep;
3568 my $config;
3575 if (! -f $kconfig) {
3604 if (/^\s*(menu)?config\s+(\S+)\s*$/) {
3606 $config = $2;
3609 add_dep $config, $ifdeps[$i];
3612 # collect the depends for the config
3615 add_dep $config, $1;
3617 # Get the configs that select this config
3620 # selected by depends on config
3621 add_dep $1, $config;
3627 $deps =~ s/^[^a-zA-Z0-9_]*//;
3628 $deps =~ s/[^a-zA-Z0-9_]*$//;
3630 my @deps = split /[^a-zA-Z0-9_]+/, $deps;
3636 $iflevel-- if ($iflevel);
3668 doprint "Could not find arch from config file\n";
3681 if (! -f $kconfig && $arch =~ /\d$/) {
3686 if (! -f $kconfig) {
3702 foreach my $config (@configs) {
3703 print OUT "$config\n";
3709 my ($config) = @_;
3711 $config =~ s/CONFIG_//;
3713 return $config;
3727 my $valid = "A-Za-z_0-9";
3754 my ($config) = @_;
3758 # if we already processed this config, skip it
3759 if (defined($processed_configs{$config})) {
3762 $processed_configs{$config} = 1;
3764 # if this config failed during this round, skip it
3765 if (defined($nochange_config{$config})) {
3769 my $kconfig = chomp_config $config;
3773 my @parents = get_depends $config;
3775 # if the parent is in the min config, check it first
3784 # Remove this config from the list of configs
3786 # .config to make sure it is missing the config that
3789 $configs{$config} = "# $config is not set";
3792 delete $configs{$config};
3796 if (!defined($configs{$config}) || $configs{$config} =~ /^#/) {
3797 return $config;
3800 doprint "disabling config $config did not change .config\n";
3802 $nochange_config{$config} = 1;
3823 if (-f $output_minconfig && !$start_minconfig_defined) {
3876 foreach my $config (@config_keys) {
3877 my $kconfig = chomp_config $config;
3885 foreach my $config (@config_keys) {
3887 if (defined($keep_configs{$config})) {
3890 doprint "$config set by $file ... ignored\n";
3891 delete $min_configs{$config};
3894 # But make sure the settings are the same. If a min config
3898 if (defined($config_ignore{$config})) {
3899 if ($config_ignore{$config} ne $min_configs{$config}) {
3900 doprint "$config is in allnoconfig as '$config_ignore{$config}'";
3901 doprint " but it is '$min_configs{$config}' in minconfig .. keeping\n";
3902 $keep_configs{$config} = $min_configs{$config};
3904 doprint "$config set by allnoconfig ... ignored\n";
3906 delete $min_configs{$config};
3915 my $config;
3918 # Now disable each config one by one and do a make oldconfig
3919 # till we find a config that changes our list.
3927 # Put configs that did not modify the config at the end.
3934 # This config didn't change the .config last time.
3936 my $config = shift @test_configs;
3937 push @test_configs, $config;
3940 # if every test config has failed to modify the .config file
3948 foreach my $config (@test_configs) {
3950 $found = test_this_config $config;
3954 # oh well, try another config
3971 $config = $found;
3973 doprint "Test with $config disabled\n";
3993 doprint "$min_configs{$config} is needed to boot the box... keeping\n";
3994 # this config is needed, add it to the ignore list.
3995 $keep_configs{$config} = $min_configs{$config};
3996 $save_configs{$config} = $min_configs{$config};
3997 delete $min_configs{$config};
4003 foreach my $config (keys %save_configs) {
4004 print OUT "$save_configs{$config}\n";
4012 # We booted without this config, remove it from the minconfigs.
4013 doprint "$config is not needed, disabling\n";
4015 delete $min_configs{$config};
4017 # Also disable anything that is not enabled in this config
4021 foreach my $config (@config_keys) {
4022 if (!defined($configs{$config})) {
4023 doprint "$config is not set, disabling\n";
4024 delete $min_configs{$config};
4031 foreach my $config (keys %keep_configs) {
4032 print OUT "$keep_configs{$config}\n";
4034 foreach my $config (keys %min_configs) {
4035 print OUT "$min_configs{$config}\n";
4069 # Some compilers use UTF-8 extended for quotes
4084 $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
4088 if (! -f $ktest_config) {
4096 if (! -f $ktest_config) {
4108 # the config file. It is best to use this variable when assigning other
4115 # The config options below it will override the defaults
4127 $opt{"LOG_FILE"} = eval_option("LOG_FILE", $opt{"LOG_FILE"}, -1);
4130 # Append any configs entered in manually to the config file.
4135 foreach my $config (@new_configs) {
4136 print OUT "$config = $entered_configs{$config}\n";
4137 $opt{$config} = process_variables($entered_configs{$config});
4146 LOG->autoflush(1);
4230 if (-x "$path/$mailer") {
4258 … $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -s \'\$SUBJECT\' \$MAILTO";
4260 $mail_command = "cat \$HEADER_FILE \$BODY_FILE | \$MAIL_PATH/\$MAILER -t \$MAILTO";
4291 doprint "No email sent: email or mailer not specified in config.\n";
4337 if (!-d $outputdir) {
4375 if (!-d $tmpdir) {
4383 $buildlog = "$tmpdir/buildlog-$machine";
4384 $testlog = "$tmpdir/testlog-$machine";
4385 $dmesg = "$tmpdir/dmesg-$machine";
4386 $output_config = "$outputdir/.config";
4413 # mistake in config file?
4453 dodie "Failed to create temp config";