tests: drop support for the hex="yes" option in getpart

The remaining datacheck sections using this for MQTT tests were not
actually used anyway!

Closes #21428
This commit is contained in:
Daniel Stenberg 2026-04-23 22:54:01 +02:00
parent 8b7e460cce
commit 2f37943406
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
18 changed files with 1 additions and 73 deletions

View file

@ -260,7 +260,7 @@ similar.
## `<reply>`
### `<data [nocheck="yes"] [sendzero="yes"] [hex="yes"] [nonewline="yes"] [crlf="yes|headers"]>`
### `<data [nocheck="yes"] [sendzero="yes"] [nonewline="yes"] [crlf="yes|headers"]>`
data to be sent to the client on its request and later verified that it
arrived safely. Set `nocheck="yes"` to prevent the test script from verifying
@ -282,9 +282,6 @@ auth tests and similar.
`sendzero=yes` means that the (FTP) server "sends" the data even if the size
is zero bytes. Used to verify curl's behavior on zero bytes transfers.
`hex=yes` means that the data is a sequence of hex pairs. It gets decoded and
used as "raw" data.
`nonewline=yes` means that the last byte (the trailing newline character)
should be cut off from the data before sending or comparing it.

View file

@ -12,9 +12,6 @@ MQTT CONNACK
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
# Remaining Length must be 2 in a CONNACK
<servercmd>

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
<servercmd>
PUBLISH-before-SUBACK TRUE
</servercmd>

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
<servercmd>
PUBLISH-before-SUBACK TRUE
short-PUBLISH TRUE

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
# error 1 - "Connection Refused, unacceptable protocol version"
<servercmd>

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -13,9 +13,6 @@ MQTTS
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT PUBLISH
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT PUBLISH
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
# error 5 - "Connection Refused, not authorized. Wrong data supplied"
<servercmd>

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
# error 5 - "Connection Refused, not authorized. No user or password supplied"
<servercmd>

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 31 31 39 30 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -12,9 +12,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 33 30 31 37 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
<servercmd>
excessive-remaining TRUE
</servercmd>

View file

@ -13,9 +13,6 @@ MQTT SUBSCRIBE
<data nocheck="yes">
hello
</data>
<datacheck hex="yes">
00 04 33 30 31 38 68 65 6c 6c 6f 5b 4c 46 5d 0a
</datacheck>
</reply>
# Client-side

View file

@ -62,15 +62,6 @@ sub normalize_part {
return join("\t", @_);
}
sub decode_hex {
my $s = $_;
# remove everything not hex
$s =~ s/[^A-Fa-f0-9]//g;
# encode everything
$s =~ s/([a-fA-F0-9][a-fA-F0-9])/chr(hex($1))/eg;
return $s;
}
sub testcaseattr {
my %hash;
for(@xml) {
@ -134,7 +125,6 @@ sub getpart {
my @this;
my $inside=0;
my $hex=0;
my $line;
for(@xml) {
@ -146,10 +136,6 @@ sub getpart {
if($inside > 1) {
push @this, $_;
}
elsif($_ =~ /$part [^>]*hex=/) {
# attempt to detect a hex-encoded part
$hex=1;
}
$inside++;
}
elsif(($inside >= 2) && ($_ =~ /^ *\<\/$part[ \>]/)) {
@ -169,13 +155,6 @@ sub getpart {
if($warning && !@this) {
print STDERR "*** getpart.pm: $section/$part returned empty!\n";
}
if($hex) {
# decode the whole array before returning it!
for(@this) {
my $decoded = decode_hex($_);
$_ = $decoded;
}
}
return @this;
}
elsif($inside >= 2) {