Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Apr 2017 22:40:40 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317306 - head/tools/regression/geom_gpt
Message-ID:  <201704222240.v3MMeevR025901@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Apr 22 22:40:39 2017
New Revision: 317306
URL: https://svnweb.freebsd.org/changeset/base/317306

Log:
  gctl_test.t: minor tweaks
  
  - Declare $count with the `my` scope operator to permit `use strict`.
  - Add `use strict`.
  - Use `use warnings` instead of using `-w` in the shebang.
  - Don't unlink $cmd when done (prevents unnecessary rebuilding).
  - Improve the error message when running with insufficient permissions, e.g.,
    non-root.
  
  MFC after:	5 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/tools/regression/geom_gpt/gctl_test.t

Modified: head/tools/regression/geom_gpt/gctl_test.t
==============================================================================
--- head/tools/regression/geom_gpt/gctl_test.t	Sat Apr 22 22:37:44 2017	(r317305)
+++ head/tools/regression/geom_gpt/gctl_test.t	Sat Apr 22 22:40:39 2017	(r317306)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 #
 # Copyright (c) 2005, 2006 Marcel Moolenaar
 # All rights reserved.
@@ -26,6 +26,9 @@
 #
 # $FreeBSD$
 
+use strict;
+use warnings;
+
 my $disk = "/tmp/disk-$$";
 my $mntpt = "/tmp/mount-$$";
 
@@ -138,12 +141,12 @@ my $out = "/tmp/$cmd.out";
 
 # Make sure we have permission to use gctl...
 if (`$cmd` =~ "^FAIL Permission denied") {
-    print "1..0 # SKIP not enough permission\n";
+    print "1..0 # SKIP insufficient permissions\n";
     unlink $cmd;
     exit 0;
 }
 
-$count = keys (%steps);
+my $count = keys (%steps);
 print "1..$count\n";
 
 my $nr = 1;
@@ -200,6 +203,4 @@ foreach my $key (sort keys %steps) {
     }
     $nr += 1;
 }
-
-unlink $cmd;
 exit 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704222240.v3MMeevR025901>