Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294658
b: refs/heads/master
c: 02ad261
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Mar 21, 2012
1 parent a812d26 commit 5105e46
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 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: 6ca996cc7cee88a6153158455a0ba8e1e79dcd2e
refs/heads/master: 02ad261704a54ebb45de370f219e55530d702291
26 changes: 22 additions & 4 deletions trunk/tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"DIE_ON_FAILURE" => 1,
"SSH_EXEC" => "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND",
"SCP_TO_TARGET" => "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE",
"SCP_TO_TARGET_INSTALL" => "\${SCP_TO_TARGET}",
"REBOOT" => "ssh \$SSH_USER\@\$MACHINE reboot",
"STOP_AFTER_SUCCESS" => 10,
"STOP_AFTER_FAILURE" => 60,
Expand Down Expand Up @@ -91,6 +92,7 @@
my $poweroff_after_halt;
my $ssh_exec;
my $scp_to_target;
my $scp_to_target_install;
my $power_off;
my $grub_menu;
my $grub_number;
Expand Down Expand Up @@ -243,6 +245,7 @@
"BUILD_TARGET" => \$build_target,
"SSH_EXEC" => \$ssh_exec,
"SCP_TO_TARGET" => \$scp_to_target,
"SCP_TO_TARGET_INSTALL" => \$scp_to_target_install,
"CHECKOUT" => \$checkout,
"TARGET_IMAGE" => \$target_image,
"LOCALVERSION" => \$localversion,
Expand Down Expand Up @@ -1349,15 +1352,30 @@ sub run_ssh {
}

sub run_scp {
my ($src, $dst) = @_;
my $cp_scp = $scp_to_target;
my ($src, $dst, $cp_scp) = @_;

$cp_scp =~ s/\$SRC_FILE/$src/g;
$cp_scp =~ s/\$DST_FILE/$dst/g;

return run_command "$cp_scp";
}

sub run_scp_install {
my ($src, $dst) = @_;

my $cp_scp = $scp_to_target_install;

return run_scp($src, $dst, $cp_scp);
}

sub run_scp_mod {
my ($src, $dst) = @_;

my $cp_scp = $scp_to_target;

return run_scp($src, $dst, $cp_scp);
}

sub get_grub_index {

if ($reboot_type ne "grub") {
Expand Down Expand Up @@ -1630,7 +1648,7 @@ sub install {

my $cp_target = eval_kernel_version $target_image;

run_scp "$outputdir/$build_target", "$cp_target" or
run_scp_install "$outputdir/$build_target", "$cp_target" or
dodie "failed to copy image";

my $install_mods = 0;
Expand Down Expand Up @@ -1665,7 +1683,7 @@ sub install {
run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
dodie "making tarball";

run_scp "$tmpdir/$modtar", "/tmp" or
run_scp_mod "$tmpdir/$modtar", "/tmp" or
dodie "failed to copy modules";

unlink "$tmpdir/$modtar";
Expand Down
14 changes: 11 additions & 3 deletions trunk/tools/testing/ktest/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,18 @@
# The variables SSH_USER, MACHINE and SSH_COMMAND are defined
#SSH_EXEC = ssh $SSH_USER@$MACHINE $SSH_COMMAND";

# The way to copy a file to the target
# The way to copy a file to the target (install and modules)
# (default scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE)
# The variables SSH_USER, MACHINE, SRC_FILE and DST_FILE are defined.
#SCP_TO_TARGET = scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE
# The variables SSH_USER, MACHINE are defined by the config
# SRC_FILE and DST_FILE are ktest internal variables and
# should only have '$' and not the '${}' notation.
# (default scp $SRC_FILE ${SSH_USER}@${MACHINE}:$DST_FILE)
#SCP_TO_TARGET = echo skip scp for $SRC_FILE $DST_FILE

# If install needs to be different than modules, then this
# option will override the SCP_TO_TARGET for installation.
# (default ${SCP_TO_TARGET} )
#SCP_TO_TARGET_INSTALL = scp $SRC_FILE tftp@tftpserver:$DST_FILE

# The nice way to reboot the target
# (default ssh $SSH_USER@$MACHINE reboot)
Expand Down

0 comments on commit 5105e46

Please sign in to comment.