From acca703a09d3567140e2080e37c51e70cd59a2cd Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 22 Apr 2017 22:40:39 +0000 Subject: [PATCH] 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 --- tools/regression/geom_gpt/gctl_test.t | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/regression/geom_gpt/gctl_test.t b/tools/regression/geom_gpt/gctl_test.t index 1e526fc227af..a6b82782b56c 100644 --- a/tools/regression/geom_gpt/gctl_test.t +++ b/tools/regression/geom_gpt/gctl_test.t @@ -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;