Skip to contentSkip to conversation

ktest: A couple more updates before asking for a pull request

PATCH New Steven Rostedt 1 participant 3 messages Aug 10, 2020 Ktest

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

cover ktest: A couple more updates before asking for a pull request

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
for-next

Head SHA1: ff131efff141fc679cccde28bc265f4c79cbe329

Colin Ian King (1):

      ktest.pl: Fix spelling mistake "Cant" -> "Can't"

Steven Rostedt (VMware) (1):
ktest.pl: Change the logic to control the size of the log file emailed

----

 tools/testing/ktest/ktest.pl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 ktest.pl: Change the logic to control the size of the log file emailed

From: "Steven Rostedt (VMware)" <[email protected]>

If the log file for a given test is larger than the max size given then use set the seek from the end of the log file instead of from the start of the test.

---
 tools/testing/ktest/ktest.pl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/testing/ktest/ktest.pl +6 -3
index 36db5b0b3647..9363a5b27339 100755
@@ -1499,18 +1499,21 @@ sub dodie {
 	my $log_file;
 
 	if (defined($opt{"LOG_FILE"})) {
-	    my $size = 0;
+	    my $whence = 0; # beginning of file
+	    my $pos = $test_log_start;
+
 	    if (defined($mail_max_size)) {
 		my $log_size = tell LOG;
 		$log_size -= $test_log_start;
 		if ($log_size > $mail_max_size) {
-		    $size = $log_size - $mail_max_size;
+		    $whence = 2; # end of file
+		    $pos = - $mail_max_size;
 		}
 	    }
 	    $log_file = "$tmpdir/log";
 	    open (L, "$opt{LOG_FILE}") or die "Can't open $opt{LOG_FILE} to read)";
 	    open (O, "> $tmpdir/log") or die "Can't open $tmpdir/log\n";
-	    seek(L, $test_log_start + $size, 0);
+	    seek(L, $pos, $whence);
 	    while (<L>) {
 		print O;
 	    }
Signature · 1 line
2.28.0
author maintainer
#2 lore raw

PATCH 2/2 ktest.pl: Fix spelling mistake "Cant" -> "Cant"

In reply to Steven Rostedt

From: Colin Ian King <[email protected]>

There is a spelling mistake in an error message. Fix it.

---
 tools/testing/ktest/ktest.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
index 9363a5b27339..cb16d2aac51c 100755
@@ -1543,7 +1543,7 @@ sub create_pty {
     my $TIOCGPTN = 0x80045430;
 
     sysopen($ptm, "/dev/ptmx", O_RDWR | O_NONBLOCK) or
-	dodie "Cant open /dev/ptmx";
+	dodie "Can't open /dev/ptmx";
 
     # unlockpt()
     $tmp = pack("i", 0);
Signature · 1 line
2.28.0