ktest.pl (8ea0e063a78df91b1ca4d23ea8d4e2e3047f6950) | ktest.pl (2d01b26a1b14ab248f850d858f2ff3de3ead6d33) |
---|---|
1#!/usr/bin/perl -w 2# 3# Copywrite 2010 - Steven Rostedt <srostedt@redhat.com>, Red Hat Inc. 4# Licensed under the terms of the GNU GPL License version 2 5# 6 7use strict; 8use IPC::Open2; --- 33 unchanged lines hidden (view full) --- 42$default{"SUCCESS_LINE"} = "login:"; 43$default{"BOOTED_TIMEOUT"} = 1; 44$default{"DIE_ON_FAILURE"} = 1; 45$default{"SSH_EXEC"} = "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND"; 46$default{"SCP_TO_TARGET"} = "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE"; 47$default{"REBOOT"} = "ssh \$SSH_USER\@\$MACHINE reboot"; 48$default{"STOP_AFTER_SUCCESS"} = 10; 49$default{"STOP_AFTER_FAILURE"} = 60; | 1#!/usr/bin/perl -w 2# 3# Copywrite 2010 - Steven Rostedt <srostedt@redhat.com>, Red Hat Inc. 4# Licensed under the terms of the GNU GPL License version 2 5# 6 7use strict; 8use IPC::Open2; --- 33 unchanged lines hidden (view full) --- 42$default{"SUCCESS_LINE"} = "login:"; 43$default{"BOOTED_TIMEOUT"} = 1; 44$default{"DIE_ON_FAILURE"} = 1; 45$default{"SSH_EXEC"} = "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND"; 46$default{"SCP_TO_TARGET"} = "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE"; 47$default{"REBOOT"} = "ssh \$SSH_USER\@\$MACHINE reboot"; 48$default{"STOP_AFTER_SUCCESS"} = 10; 49$default{"STOP_AFTER_FAILURE"} = 60; |
50$default{"STOP_TEST_AFTER"} = 600; |
|
50$default{"LOCALVERSION"} = "-test"; 51 52my $ktest_config; 53my $version; 54my $machine; 55my $ssh_user; 56my $tmpdir; 57my $builddir; --- 39 unchanged lines hidden (view full) --- 97my $bisect_sleep_time; 98my $store_failures; 99my $timeout; 100my $booted_timeout; 101my $console; 102my $success_line; 103my $stop_after_success; 104my $stop_after_failure; | 51$default{"LOCALVERSION"} = "-test"; 52 53my $ktest_config; 54my $version; 55my $machine; 56my $ssh_user; 57my $tmpdir; 58my $builddir; --- 39 unchanged lines hidden (view full) --- 98my $bisect_sleep_time; 99my $store_failures; 100my $timeout; 101my $booted_timeout; 102my $console; 103my $success_line; 104my $stop_after_success; 105my $stop_after_failure; |
106my $stop_test_after; |
|
105my $build_target; 106my $target_image; 107my $localversion; 108my $iteration = 0; 109my $successes = 0; 110 111my %entered_configs; 112my %config_help; --- 650 unchanged lines hidden (view full) --- 763 764 open(DMESG, "> $dmesg") or 765 die "unable to write to $dmesg"; 766 767 reboot_to; 768 769 my $success_start; 770 my $failure_start; | 107my $build_target; 108my $target_image; 109my $localversion; 110my $iteration = 0; 111my $successes = 0; 112 113my %entered_configs; 114my %config_help; --- 650 unchanged lines hidden (view full) --- 765 766 open(DMESG, "> $dmesg") or 767 die "unable to write to $dmesg"; 768 769 reboot_to; 770 771 my $success_start; 772 my $failure_start; |
773 my $monitor_start = time; 774 my $done = 0; |
|
771 | 775 |
772 for (;;) { | 776 while (!$done) { |
773 774 if ($booted) { 775 $line = wait_for_input($monitor_fp, $booted_timeout); 776 } else { 777 $line = wait_for_input($monitor_fp); 778 } 779 780 last if (!defined($line)); --- 45 unchanged lines hidden (view full) --- 826 if ($full_line =~ /Kernel panic -/) { 827 $failure_start = time; 828 $bug = 1; 829 } 830 831 if ($line =~ /\n/) { 832 $full_line = ""; 833 } | 777 778 if ($booted) { 779 $line = wait_for_input($monitor_fp, $booted_timeout); 780 } else { 781 $line = wait_for_input($monitor_fp); 782 } 783 784 last if (!defined($line)); --- 45 unchanged lines hidden (view full) --- 830 if ($full_line =~ /Kernel panic -/) { 831 $failure_start = time; 832 $bug = 1; 833 } 834 835 if ($line =~ /\n/) { 836 $full_line = ""; 837 } |
838 839 if ($stop_test_after > 0 && !$booted && !$bug) { 840 if (time - $monitor_start > $stop_test_after) { 841 $done = 1; 842 } 843 } |
|
834 } 835 836 close(DMESG); 837 838 if ($bug) { 839 return 0 if ($in_bisect); 840 fail "failed - got a bug report" and return 0; 841 } --- 1155 unchanged lines hidden (view full) --- 1997 $bisect_skip = set_test_option("BISECT_SKIP", $i); 1998 $store_failures = set_test_option("STORE_FAILURES", $i); 1999 $timeout = set_test_option("TIMEOUT", $i); 2000 $booted_timeout = set_test_option("BOOTED_TIMEOUT", $i); 2001 $console = set_test_option("CONSOLE", $i); 2002 $success_line = set_test_option("SUCCESS_LINE", $i); 2003 $stop_after_success = set_test_option("STOP_AFTER_SUCCESS", $i); 2004 $stop_after_failure = set_test_option("STOP_AFTER_FAILURE", $i); | 844 } 845 846 close(DMESG); 847 848 if ($bug) { 849 return 0 if ($in_bisect); 850 fail "failed - got a bug report" and return 0; 851 } --- 1155 unchanged lines hidden (view full) --- 2007 $bisect_skip = set_test_option("BISECT_SKIP", $i); 2008 $store_failures = set_test_option("STORE_FAILURES", $i); 2009 $timeout = set_test_option("TIMEOUT", $i); 2010 $booted_timeout = set_test_option("BOOTED_TIMEOUT", $i); 2011 $console = set_test_option("CONSOLE", $i); 2012 $success_line = set_test_option("SUCCESS_LINE", $i); 2013 $stop_after_success = set_test_option("STOP_AFTER_SUCCESS", $i); 2014 $stop_after_failure = set_test_option("STOP_AFTER_FAILURE", $i); |
2015 $stop_test_after = set_test_option("STOP_TEST_AFTER", $i); |
|
2005 $build_target = set_test_option("BUILD_TARGET", $i); 2006 $ssh_exec = set_test_option("SSH_EXEC", $i); 2007 $scp_to_target = set_test_option("SCP_TO_TARGET", $i); 2008 $target_image = set_test_option("TARGET_IMAGE", $i); 2009 $localversion = set_test_option("LOCALVERSION", $i); 2010 2011 chdir $builddir || die "can't change directory to $builddir"; 2012 --- 99 unchanged lines hidden --- | 2016 $build_target = set_test_option("BUILD_TARGET", $i); 2017 $ssh_exec = set_test_option("SSH_EXEC", $i); 2018 $scp_to_target = set_test_option("SCP_TO_TARGET", $i); 2019 $target_image = set_test_option("TARGET_IMAGE", $i); 2020 $localversion = set_test_option("LOCALVERSION", $i); 2021 2022 chdir $builddir || die "can't change directory to $builddir"; 2023 --- 99 unchanged lines hidden --- |