When creating a ktest config or if te config only has build only tests, some of the manditory config options are not needed. Do not ask for them if all tests in the config file are just build tests.
Unified · Split
| @@ -22,7 +22,7 @@ my %default; · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | #default opts |
| 24 | 24 | $default{"NUM_TESTS"} = 1; |
| 25 | −$default{"TEST_TYPE"} = "test"; | |
| 25 | +$default{"TEST_TYPE"} = "build"; | |
| 26 | 26 | $default{"BUILD_TYPE"} = "randconfig"; |
| 27 | 27 | $default{"MAKE_CMD"} = "make"; |
| 28 | 28 | $default{"TIMEOUT"} = 120; |
| @@ -136,6 +136,10 @@ my $localversion; · 107 unmodified lines | ||
| 136 | 136 | my $iteration = 0; |
| 137 | 137 | my $successes = 0; |
| 138 | 138 | |
| 139 | +# set when a test is something other that just building | |
| 140 | +# which would require more options. | |
| 141 | +my $buildonly = 1; | |
| 142 | + | |
| 139 | 143 | my %entered_configs; |
| 140 | 144 | my %config_help; |
| 141 | 145 | my %variable; |
| @@ -149,6 +153,7 @@ chomp ($variable{"PWD"} = `pwd`); · 7 unmodified lines | ||
| 149 | 153 | |
| 150 | 154 | $config_help{"MACHINE"} = << "EOF" |
| 151 | 155 | The machine hostname that you will test. |
| 156 | + For build only tests, it is still needed to differentiate log files. | |
| 152 | 157 | EOF |
| 153 | 158 | ; |
| 154 | 159 | $config_help{"SSH_USER"} = << "EOF" |
| @@ -321,15 +326,22 @@ sub get_ktest_config { · 166 unmodified lines | ||
| 321 | 326 | |
| 322 | 327 | sub get_ktest_configs { |
| 323 | 328 | get_ktest_config("MACHINE"); |
| 324 | − get_ktest_config("SSH_USER"); | |
| 325 | 329 | get_ktest_config("BUILD_DIR"); |
| 326 | 330 | get_ktest_config("OUTPUT_DIR"); |
| 327 | − get_ktest_config("BUILD_TARGET"); | |
| 328 | − get_ktest_config("TARGET_IMAGE"); | |
| 329 | − get_ktest_config("POWER_CYCLE"); | |
| 330 | − get_ktest_config("CONSOLE"); | |
| 331 | + | |
| 332 | + # options required for other than just building a kernel | |
| 333 | + if (!$buildonly) { | |
| 334 | + get_ktest_config("SSH_USER"); | |
| 335 | + get_ktest_config("BUILD_TARGET"); | |
| 336 | + get_ktest_config("TARGET_IMAGE"); | |
| 337 | + get_ktest_config("POWER_CYCLE"); | |
| 338 | + get_ktest_config("CONSOLE"); | |
| 339 | + } | |
| 340 | + | |
| 331 | 341 | get_ktest_config("LOCALVERSION"); |
| 332 | 342 | |
| 343 | + return if ($buildonly); | |
| 344 | + | |
| 333 | 345 | my $rtype = $opt{"REBOOT_TYPE"}; |
| 334 | 346 | |
| 335 | 347 | if (!defined($rtype)) { |
| @@ -388,6 +400,12 @@ sub process_variables { · 52 unmodified lines | ||
| 388 | 400 | sub set_value { |
| 389 | 401 | my ($lvalue, $rvalue, $override, $overrides, $name) = @_; |
| 390 | 402 | |
| 403 | + if ($lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $rvalue ne "build") { | |
| 404 | + # Note if a test is something other than build, then we | |
| 405 | + # will need other manditory options. | |
| 406 | + $buildonly = 0; | |
| 407 | + } | |
| 408 | + | |
| 391 | 409 | if (defined($opt{$lvalue})) { |
| 392 | 410 | if (!$override || defined(${$overrides}{$lvalue})) { |
| 393 | 411 | my $extra = ""; |
| @@ -3271,18 +3289,19 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { · 2877 unmodified lines | ||
| 3271 | 3289 | $ENV{"SSH_USER"} = $ssh_user; |
| 3272 | 3290 | $ENV{"MACHINE"} = $machine; |
| 3273 | 3291 | |
| 3274 | − $target = "$ssh_user\@$machine"; | |
| 3275 | − | |
| 3276 | 3292 | $buildlog = "$tmpdir/buildlog-$machine"; |
| 3277 | 3293 | $testlog = "$tmpdir/testlog-$machine"; |
| 3278 | 3294 | $dmesg = "$tmpdir/dmesg-$machine"; |
| 3279 | 3295 | $make = "$makecmd O=$outputdir"; |
| 3280 | 3296 | $output_config = "$outputdir/.config"; |
| 3281 | 3297 | |
| 3282 | − if ($reboot_type eq "grub") { | |
| 3283 | − dodie "GRUB_MENU not defined" if (!defined($grub_menu)); | |
| 3284 | − } elsif (!defined($reboot_script)) { | |
| 3285 | − dodie "REBOOT_SCRIPT not defined" | |
| 3298 | + if (!$buildonly) { | |
| 3299 | + $target = "$ssh_user\@$machine"; | |
| 3300 | + if ($reboot_type eq "grub") { | |
| 3301 | + dodie "GRUB_MENU not defined" if (!defined($grub_menu)); | |
| 3302 | + } elsif (!defined($reboot_script)) { | |
| 3303 | + dodie "REBOOT_SCRIPT not defined" | |
| 3304 | + } | |
| 3286 | 3305 | } |
| 3287 | 3306 | |
| 3288 | 3307 | my $run_type = $build_type; |