Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285890
b: refs/heads/master
c: bb8474b
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Dec 23, 2011
1 parent 0e147b9 commit 4bcc07f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4261d0f62ccbb42184d13b43807b36b100e8fb5
refs/heads/master: bb8474b181a715182a110c8ed2b3786ea7487f2b
43 changes: 31 additions & 12 deletions trunk/tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#default opts
$default{"NUM_TESTS"} = 1;
$default{"TEST_TYPE"} = "test";
$default{"TEST_TYPE"} = "build";
$default{"BUILD_TYPE"} = "randconfig";
$default{"MAKE_CMD"} = "make";
$default{"TIMEOUT"} = 120;
Expand Down Expand Up @@ -136,6 +136,10 @@
my $iteration = 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 %config_help;
my %variable;
Expand All @@ -149,6 +153,7 @@

$config_help{"MACHINE"} = << "EOF"
The machine hostname that you will test.
For build only tests, it is still needed to differentiate log files.
EOF
;
$config_help{"SSH_USER"} = << "EOF"
Expand Down Expand Up @@ -321,15 +326,22 @@ sub get_ktest_config {

sub get_ktest_configs {
get_ktest_config("MACHINE");
get_ktest_config("SSH_USER");
get_ktest_config("BUILD_DIR");
get_ktest_config("OUTPUT_DIR");
get_ktest_config("BUILD_TARGET");
get_ktest_config("TARGET_IMAGE");
get_ktest_config("POWER_CYCLE");
get_ktest_config("CONSOLE");

# options required for other than just building a kernel
if (!$buildonly) {
get_ktest_config("SSH_USER");
get_ktest_config("BUILD_TARGET");
get_ktest_config("TARGET_IMAGE");
get_ktest_config("POWER_CYCLE");
get_ktest_config("CONSOLE");
}

get_ktest_config("LOCALVERSION");

return if ($buildonly);

my $rtype = $opt{"REBOOT_TYPE"};

if (!defined($rtype)) {
Expand Down Expand Up @@ -388,6 +400,12 @@ sub process_variables {
sub set_value {
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 (!$override || defined(${$overrides}{$lvalue})) {
my $extra = "";
Expand Down Expand Up @@ -3271,18 +3289,19 @@ sub set_test_option {
$ENV{"SSH_USER"} = $ssh_user;
$ENV{"MACHINE"} = $machine;

$target = "$ssh_user\@$machine";

$buildlog = "$tmpdir/buildlog-$machine";
$testlog = "$tmpdir/testlog-$machine";
$dmesg = "$tmpdir/dmesg-$machine";
$make = "$makecmd O=$outputdir";
$output_config = "$outputdir/.config";

if ($reboot_type eq "grub") {
dodie "GRUB_MENU not defined" if (!defined($grub_menu));
} elsif (!defined($reboot_script)) {
dodie "REBOOT_SCRIPT not defined"
if (!$buildonly) {
$target = "$ssh_user\@$machine";
if ($reboot_type eq "grub") {
dodie "GRUB_MENU not defined" if (!defined($grub_menu));
} elsif (!defined($reboot_script)) {
dodie "REBOOT_SCRIPT not defined"
}
}

my $run_type = $build_type;
Expand Down

0 comments on commit 4bcc07f

Please sign in to comment.