mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-27 16:12:04 +00:00
Sort items in Pingback.t like they're sorted in Pingback.pm to avoid failing tests on some platforms.
This commit is contained in:
@@ -126,9 +126,19 @@ sub test_pingback {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $expect_post;
|
||||||
|
if ( $args{post} ) {
|
||||||
|
$expect_post = join("\n",
|
||||||
|
map { "$_->{id};$_->{item};$_->{val}" }
|
||||||
|
sort {
|
||||||
|
$a->{item} cmp $b->{item} ||
|
||||||
|
$a->{id} cmp $b->{id}
|
||||||
|
} @{$args{post}});
|
||||||
|
$expect_post .= "\n";
|
||||||
|
}
|
||||||
is(
|
is(
|
||||||
$post ? ($post->{content} || '') : '',
|
$post ? ($post->{content} || '') : '',
|
||||||
$args{post},
|
$expect_post || '',
|
||||||
"$args{name} client response"
|
"$args{name} client response"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -152,7 +162,18 @@ test_pingback(
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
# client should POST this
|
# client should POST this
|
||||||
post => "$general_id;Data::Dumper;$dd_ver\n$general_id;Perl;$perl_ver\n",
|
post => [
|
||||||
|
{
|
||||||
|
item => 'Data::Dumper',
|
||||||
|
id => $general_id,
|
||||||
|
val => $dd_ver,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
item => 'Perl',
|
||||||
|
id => $general_id,
|
||||||
|
val => $perl_ver,
|
||||||
|
},
|
||||||
|
],
|
||||||
# Server should return these suggetions after the client posts
|
# Server should return these suggetions after the client posts
|
||||||
sug => [
|
sug => [
|
||||||
'Data::Printer is nicer.',
|
'Data::Printer is nicer.',
|
||||||
@@ -174,7 +195,18 @@ test_pingback(
|
|||||||
content => "",
|
content => "",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
post => "$general_id;Data::Dumper;$dd_ver\n$general_id;Perl;$perl_ver\n",
|
post => [
|
||||||
|
{
|
||||||
|
item => 'Data::Dumper',
|
||||||
|
id => $general_id,
|
||||||
|
val => $dd_ver,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
item => 'Perl',
|
||||||
|
id => $general_id,
|
||||||
|
val => $perl_ver,
|
||||||
|
},
|
||||||
|
],
|
||||||
sug => undef,
|
sug => undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -184,7 +216,7 @@ test_pingback(
|
|||||||
name => "No response to GET",
|
name => "No response to GET",
|
||||||
response => [],
|
response => [],
|
||||||
no_response => 1,
|
no_response => 1,
|
||||||
post => "",
|
post => undef,
|
||||||
sug => undef,
|
sug => undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -199,7 +231,18 @@ test_pingback(
|
|||||||
content => "Perl;perl_version;PERL_VERSION\nData::Dumper;perl_module_version\n",
|
content => "Perl;perl_version;PERL_VERSION\nData::Dumper;perl_module_version\n",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
post => "$general_id;Data::Dumper;$dd_ver\n$general_id;Perl;$perl_ver\n",
|
post => [
|
||||||
|
{
|
||||||
|
id => $general_id,
|
||||||
|
item => 'Data::Dumper',
|
||||||
|
val => $dd_ver,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id => $general_id,
|
||||||
|
item => 'Perl',
|
||||||
|
val => $perl_ver,
|
||||||
|
},
|
||||||
|
],
|
||||||
sug => undef,
|
sug => undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -223,7 +266,13 @@ SKIP: {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
# client should POST this
|
# client should POST this
|
||||||
post => "$master_id;MySQL;$mysql_ver $mysql_distro\n",
|
post => [
|
||||||
|
{
|
||||||
|
id => $master_id,
|
||||||
|
item => 'MySQL',
|
||||||
|
val => "$mysql_ver $mysql_distro",
|
||||||
|
}
|
||||||
|
],
|
||||||
# Server should return these suggetions after the client posts
|
# Server should return these suggetions after the client posts
|
||||||
sug => ['Percona Server is fast.'],
|
sug => ['Percona Server is fast.'],
|
||||||
);
|
);
|
||||||
@@ -440,7 +489,18 @@ SKIP: {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
# client should POST this
|
# client should POST this
|
||||||
post => "$slave1_id;MySQL;$mysql_ver $mysql_distro\n$master_id;MySQL;$mysql_ver $mysql_distro\n",
|
post => [
|
||||||
|
{
|
||||||
|
id => $slave1_id,
|
||||||
|
item => 'MySQL',
|
||||||
|
val => "$mysql_ver $mysql_distro",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id => $master_id,
|
||||||
|
item => 'MySQL',
|
||||||
|
val => "$mysql_ver $mysql_distro",
|
||||||
|
}
|
||||||
|
],
|
||||||
# Server should return these suggetions after the client posts
|
# Server should return these suggetions after the client posts
|
||||||
sug => [
|
sug => [
|
||||||
'Percona Server is fast.',
|
'Percona Server is fast.',
|
||||||
|
Reference in New Issue
Block a user