mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-05-16 01:07:12 +08:00
Fixes per Daniel's review
This commit is contained in:
+2
-2
@@ -5091,7 +5091,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -7087,7 +7087,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -4241,7 +4241,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -4669,7 +4669,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -3683,7 +3683,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -4584,7 +4584,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -4794,7 +4794,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -5461,7 +5461,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -4607,7 +4607,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -5216,7 +5216,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -3447,7 +3447,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -4335,7 +4335,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -3387,7 +3387,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -3831,7 +3831,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -4531,7 +4531,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -5734,7 +5734,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -6113,7 +6113,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -7262,7 +7262,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -6124,7 +6124,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -7237,7 +7237,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -7146,7 +7146,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -9900,7 +9900,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -7298,7 +7298,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -8499,7 +8499,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -13228,7 +13228,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -16994,7 +16994,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -3796,7 +3796,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -4414,7 +4414,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -4419,7 +4419,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -5331,7 +5331,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -1348,7 +1348,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -11184,7 +11184,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -9527,7 +9527,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -12316,7 +12316,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+2
-2
@@ -11595,7 +11595,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -12902,7 +12902,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
@@ -4708,7 +4708,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
@@ -5686,7 +5686,7 @@ MAGIC_version_check
|
||||
|
||||
https, http, auto, off
|
||||
|
||||
C<auto> first tries using C<https>, and resolts to C<http> if that fails.
|
||||
C<auto> first tries using C<https>, and resorts to C<http> if that fails.
|
||||
Keep in mind that C<https> might not be available if
|
||||
C<IO::Socket::SSL> is not installed on your system, although
|
||||
C<--version-check http> should work everywhere.
|
||||
|
||||
+1
-1
@@ -420,7 +420,7 @@ sub validate_options {
|
||||
chomp(@values);
|
||||
|
||||
return if grep { $value eq $_ } @values;
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
$o->save_error("--version-check invalid value $value. Accepted values are "
|
||||
. join(", ", @values[0..$#values-1]) . " and $values[-1]" );
|
||||
}
|
||||
|
||||
|
||||
+9
-8
@@ -513,16 +513,17 @@ SKIP: {
|
||||
# Check that the --v-c OPT validation works everywhere
|
||||
# #############################################################################
|
||||
|
||||
for my $exec ( grep { slurp_file($_) =~ /package Pingback;/ }
|
||||
grep { !/~/ }
|
||||
glob("$trunk/bin/*")
|
||||
)
|
||||
{
|
||||
my $output = `$exec --version-check ftp`;
|
||||
use File::Basename qw(basename);
|
||||
|
||||
my @vc_tools = grep { chomp; basename($_) =~ /\A[a-z-]+\z/ }
|
||||
`grep --files-with-matches Pingback $trunk/bin/*`;
|
||||
|
||||
foreach my $tool ( @vc_tools ) {
|
||||
my $output = `$tool --version-check ftp`;
|
||||
like(
|
||||
$output,
|
||||
qr/\Q* --version-check invalid value ftp. Accepted values are https, http, auto and off/,
|
||||
"Valid values for v-c are checked in $exec"
|
||||
qr/\Q* --version-check invalid value ftp. Accepted values are https, http, auto and off/,
|
||||
"Valid values for v-c are checked in $tool"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user