浏览代码

plugins/test: fix codespell issues

Mario Trangoni 7 年之前
父节点
当前提交
ebc7ad1475

+ 1 - 1
plugins-root/check_icmp.c

@@ -689,7 +689,7 @@ main(int argc, char **argv)
 		if(max_completion_time > (u_int)timeout * 1000000) {
 			printf("max_completion_time: %llu  timeout: %u\n",
 				   max_completion_time, timeout);
-			printf("Timout must be at lest %llu\n",
+			printf("Timeout must be at lest %llu\n",
 				   max_completion_time / 1000000 + 1);
 		}
 	}

+ 1 - 1
plugins-root/pst3.c

@@ -257,6 +257,6 @@ void usage() {
   printf("\tRSS      - Real memory usage (kilobytes)\n");
   printf("\t%%CPU     - CPU usage\n");
   printf("\tCOMMAND  - Command being run\n");
-  printf("\tARGS     - Full command line with arguements\n");
+  printf("\tARGS     - Full command line with arguments\n");
   return;
 }

+ 2 - 2
plugins/remove_perfdata.c

@@ -116,7 +116,7 @@ main(int argc, char **argv)
                     }
                 }
 
-                /* when we reach an unqouted |, stop printing */
+                /* when we reach an unquoted |, stop printing */
                 if (!in_quotes && c == '|')
                     break;
 
@@ -134,7 +134,7 @@ main(int argc, char **argv)
             break;
         }
 
-        /* for everything else, theres mastercard - or printing the full line to the screen */
+        /* for everything else, there's mastercard - or printing the full line to the screen */
         else {
             printf("%s\n", chld_out.line[i]);
         }

+ 5 - 5
plugins/t/check_by_ssh.t

@@ -27,7 +27,7 @@ plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_servic
 plan tests => 42;
 
 # Some random check strings/response
-my @responce = ('OK: Everything is fine',
+my @response = ('OK: Everything is fine',
                 'WARNING: Hey, pick me, pick me',
                 'CRITICAL: Shit happens',
                 'UNKNOWN: What can I do for ya',
@@ -35,7 +35,7 @@ my @responce = ('OK: Everything is fine',
 );
 my @responce_re;
 my @check;
-for (@responce) {
+for (@response) {
 	push(@check, "echo $_");
 	my $re_str = $_;
 	$re_str =~ s{(.)} { "\Q$1" }ge;
@@ -55,7 +55,7 @@ for (my $i=0; $i<4; $i++) {
 		"./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[$i]; exit $i'"
 		);
 	cmp_ok($result->return_code, '==', $i, "Exit with return code $i");
-	is($result->output, $responce[$i], "Status text is correct for check $i");
+	is($result->output, $response[$i], "Status text is correct for check $i");
 }
 
 $result = NPTest->testCmd(
@@ -92,7 +92,7 @@ $result = NPTest->testCmd(
 	"./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[4]; exit 8'"
 	);
 cmp_ok($result->return_code, '==', 8, "Exit with return code 8 (out of bounds)");
-is($result->output, $responce[4], "Return proper status text even with unknown status codes");
+is($result->output, $response[4], "Return proper status text even with unknown status codes");
 
 $result = NPTest->testCmd(
 	"./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'"
@@ -116,7 +116,7 @@ my %linemap = (
 foreach my $line (0, 2, 4, 6) {
 	my $code = $linemap{$line};
 	my $statline = $line+1;
-	is($lines[$line], "$responce[$code]", "multiple checks status text is correct for line $line");
+	is($lines[$line], "$response[$code]", "multiple checks status text is correct for line $line");
 	is($lines[$statline], "STATUS CODE: $code", "multiple check status code is correct for line $line");
 }
 

+ 4 - 4
plugins/t/check_disk.t

@@ -329,15 +329,15 @@ cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after grou
 $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -r '('" );
 cmp_ok( $result->return_code, '==', 3, "Exit UNKNOWN if regex is not compileable");
 
-# ignore: exit unknown, if all pathes are deselected using -i
+# ignore: exit unknown, if all paths are deselected using -i
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '$mountpoint_valid' -i '$mountpoint2_valid'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case sensitive)");
 
-# ignore: exit unknown, if all pathes are deselected using -I
+# ignore: exit unknown, if all paths are deselected using -I
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -I '".uc($mountpoint_valid)."' -I '".uc($mountpoint2_valid)."'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case insensitive)");
 
-# ignore: exit unknown, if all pathes are deselected using -i
+# ignore: exit unknown, if all paths are deselected using -i
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '.*'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored using -i '.*'");
 
@@ -346,7 +346,7 @@ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mo
 like( $result->output, qr/$mountpoint_valid/, "output data does have $mountpoint_valid in it");
 unlike( $result->output, qr/$mountpoint2_valid/, "output data does not have $mountpoint2_valid in it");
 
-# ignore: test if all pathes are listed when ignore regex doesn't match
+# ignore: test if all paths are listed when ignore regex doesn't match
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '^barbazJodsf\$'");
 like( $result->output, qr/$mountpoint_valid/, "ignore: output data does have $mountpoint_valid when regex doesn't match");
 like( $result->output, qr/$mountpoint2_valid/,"ignore: output data does have $mountpoint2_valid when regex doesn't match");

+ 1 - 1
plugins/t/check_mysql.t

@@ -5,7 +5,7 @@
 #
 #
 # These are the database permissions required for this test:
-#  GRANT SELECT ON $db.* TO $user@$host INDENTIFIED BY '$password';
+#  GRANT SELECT ON $db.* TO $user@$host IDENTIFIED BY '$password';
 #  GRANT SUPER, REPLICATION CLIENT ON *.* TO $user@$host;
 # Check with:
 #  mysql -u$user -p$password -h$host $db

+ 1 - 1
plugins/t/check_nagios.t

@@ -36,7 +36,7 @@ cmp_ok( $result->return_code, '==', 1, "Log over 5 minutes old" );
 like  ( $result->output, $warningOutput, "Output for warning correct" );
 
 my $now = time;
-# This substitution is dependant on the testcase
+# This substitution is dependent on the testcase
 system( "perl -pe 's/1133537544/$now/' $nagios1 > $nagios1.tmp" ) == 0 or die "Problem with munging $nagios1";
 
 $result = NPTest->testCmd(

+ 2 - 2
plugins/tests/check_snmp.t

@@ -51,7 +51,7 @@ if ($pid) {
 	#print "child\n";
 
 	print "Please contact SNMP at: $port_snmp\n";
-	close(STDERR); # Coment out to debug snmpd problems (most errors sent there are OK)
+	close(STDERR); # Comment out to debug snmpd problems (most errors sent there are OK)
 	exec("snmpd -c tests/conf/snmpd.conf -C -f -r udp:$port_snmp");
 }
 
@@ -221,7 +221,7 @@ is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quo
 
 $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.15 -r 'CUSTOM CHECK OK'" );
 is($res->return_code, 0, "String check should check whole string, not a parsed number" );
-is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check witn numbers returns whole string");
+is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check with numbers returns whole string");
 
 $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" );
 is($res->return_code, 0, "Negative integer check OK" );

+ 1 - 1
plugins/utils.h

@@ -7,7 +7,7 @@
 /* The purpose of this package is to provide safer alternatives to C
 functions that might otherwise be vulnerable to hacking. This
 currently includes a standard suite of validation routines to be sure
-that an string argument acually converts to its intended type and a
+that an string argument actually converts to its intended type and a
 suite of string handling routine that do their own memory management
 in order to resist overflow attacks. In addition, a few functions are
 provided to standardize version and error reporting across the entire

+ 6 - 6
po/nagios-plugins.pot

@@ -803,7 +803,7 @@ msgstr ""
 
 #: plugins/check_fping.c:154
 #, c-format
-msgid "FPING UNKNOW - %s not found\n"
+msgid "FPING UNKNOWN - %s not found\n"
 msgstr ""
 
 #: plugins/check_fping.c:158
@@ -1412,7 +1412,7 @@ msgstr ""
 #: plugins/check_http.c:1392
 msgid ""
 "other errors return STATE_UNKNOWN.  Successful connects, but incorrect "
-"reponse"
+"response"
 msgstr ""
 
 #: plugins/check_http.c:1393
@@ -3287,7 +3287,7 @@ msgid ""
 msgstr ""
 
 #: plugins/check_pgsql.c:467
-msgid "a password, but no effort is made to obsure or encrypt the password."
+msgid "a password, but no effort is made to obscure or encrypt the password."
 msgstr ""
 
 #: plugins/check_ping.c:141
@@ -3786,7 +3786,7 @@ msgid "The user to authenticate"
 msgstr ""
 
 #: plugins/check_radius.c:352
-msgid "Password for autentication (SECURITY RISK)"
+msgid "Password for authentication (SECURITY RISK)"
 msgstr ""
 
 #: plugins/check_radius.c:354
@@ -3919,7 +3919,7 @@ msgstr ""
 
 #: plugins/check_real.c:440
 msgid ""
-"but incorrect reponse messages from the host result in STATE_WARNING return"
+"but incorrect response messages from the host result in STATE_WARNING return"
 msgstr ""
 
 #: plugins/check_real.c:441
@@ -4134,7 +4134,7 @@ msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN.  Successful"
 msgstr ""
 
 #: plugins/check_smtp.c:829
-msgid "connects, but incorrect reponse messages from the host result in"
+msgid "connects, but incorrect response messages from the host result in"
 msgstr ""
 
 #: plugins/check_smtp.c:830