Commit bb8474b1 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

ktest: Do not ask for some options if the only test is build

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.
Suggested-by: default avatarDarren Hart <dvhart@linux.intel.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent c4261d0f
...@@ -22,7 +22,7 @@ my %default; ...@@ -22,7 +22,7 @@ my %default;
#default opts #default opts
$default{"NUM_TESTS"} = 1; $default{"NUM_TESTS"} = 1;
$default{"TEST_TYPE"} = "test"; $default{"TEST_TYPE"} = "build";
$default{"BUILD_TYPE"} = "randconfig"; $default{"BUILD_TYPE"} = "randconfig";
$default{"MAKE_CMD"} = "make"; $default{"MAKE_CMD"} = "make";
$default{"TIMEOUT"} = 120; $default{"TIMEOUT"} = 120;
...@@ -136,6 +136,10 @@ my $localversion; ...@@ -136,6 +136,10 @@ my $localversion;
my $iteration = 0; my $iteration = 0;
my $successes = 0; my $successes = 0;
# set when a test is something other that just building
# which would require more options.
my $buildonly = 1;
my %entered_configs; my %entered_configs;
my %config_help; my %config_help;
my %variable; my %variable;
...@@ -149,6 +153,7 @@ chomp ($variable{"PWD"} = `pwd`); ...@@ -149,6 +153,7 @@ chomp ($variable{"PWD"} = `pwd`);
$config_help{"MACHINE"} = << "EOF" $config_help{"MACHINE"} = << "EOF"
The machine hostname that you will test. The machine hostname that you will test.
For build only tests, it is still needed to differentiate log files.
EOF EOF
; ;
$config_help{"SSH_USER"} = << "EOF" $config_help{"SSH_USER"} = << "EOF"
...@@ -321,15 +326,22 @@ sub get_ktest_config { ...@@ -321,15 +326,22 @@ sub get_ktest_config {
sub get_ktest_configs { sub get_ktest_configs {
get_ktest_config("MACHINE"); get_ktest_config("MACHINE");
get_ktest_config("SSH_USER");
get_ktest_config("BUILD_DIR"); get_ktest_config("BUILD_DIR");
get_ktest_config("OUTPUT_DIR"); get_ktest_config("OUTPUT_DIR");
# options required for other than just building a kernel
if (!$buildonly) {
get_ktest_config("SSH_USER");
get_ktest_config("BUILD_TARGET"); get_ktest_config("BUILD_TARGET");
get_ktest_config("TARGET_IMAGE"); get_ktest_config("TARGET_IMAGE");
get_ktest_config("POWER_CYCLE"); get_ktest_config("POWER_CYCLE");
get_ktest_config("CONSOLE"); get_ktest_config("CONSOLE");
}
get_ktest_config("LOCALVERSION"); get_ktest_config("LOCALVERSION");
return if ($buildonly);
my $rtype = $opt{"REBOOT_TYPE"}; my $rtype = $opt{"REBOOT_TYPE"};
if (!defined($rtype)) { if (!defined($rtype)) {
...@@ -388,6 +400,12 @@ sub process_variables { ...@@ -388,6 +400,12 @@ sub process_variables {
sub set_value { sub set_value {
my ($lvalue, $rvalue, $override, $overrides, $name) = @_; my ($lvalue, $rvalue, $override, $overrides, $name) = @_;
if ($lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $rvalue ne "build") {
# Note if a test is something other than build, then we
# will need other manditory options.
$buildonly = 0;
}
if (defined($opt{$lvalue})) { if (defined($opt{$lvalue})) {
if (!$override || defined(${$overrides}{$lvalue})) { if (!$override || defined(${$overrides}{$lvalue})) {
my $extra = ""; my $extra = "";
...@@ -3271,19 +3289,20 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { ...@@ -3271,19 +3289,20 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
$ENV{"SSH_USER"} = $ssh_user; $ENV{"SSH_USER"} = $ssh_user;
$ENV{"MACHINE"} = $machine; $ENV{"MACHINE"} = $machine;
$target = "$ssh_user\@$machine";
$buildlog = "$tmpdir/buildlog-$machine"; $buildlog = "$tmpdir/buildlog-$machine";
$testlog = "$tmpdir/testlog-$machine"; $testlog = "$tmpdir/testlog-$machine";
$dmesg = "$tmpdir/dmesg-$machine"; $dmesg = "$tmpdir/dmesg-$machine";
$make = "$makecmd O=$outputdir"; $make = "$makecmd O=$outputdir";
$output_config = "$outputdir/.config"; $output_config = "$outputdir/.config";
if (!$buildonly) {
$target = "$ssh_user\@$machine";
if ($reboot_type eq "grub") { if ($reboot_type eq "grub") {
dodie "GRUB_MENU not defined" if (!defined($grub_menu)); dodie "GRUB_MENU not defined" if (!defined($grub_menu));
} elsif (!defined($reboot_script)) { } elsif (!defined($reboot_script)) {
dodie "REBOOT_SCRIPT not defined" dodie "REBOOT_SCRIPT not defined"
} }
}
my $run_type = $build_type; my $run_type = $build_type;
if ($test_type eq "patchcheck") { if ($test_type eq "patchcheck") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment