Skip to content

Commit d88bf2d

Browse files
committed
Fix TestAuth_Run_BinaryTokenPreservation on Linux CI
Use #!/bin/bash instead of #!/bin/sh in the test script. On Linux, /bin/sh is typically dash, which doesn't support \x hex escapes in printf - it outputs them as literal characters instead of binary bytes.
1 parent 6ecb061 commit d88bf2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/broker/auth_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,12 @@ func TestAuth_Run_BinaryTokenPreservation(t *testing.T) {
336336
// Test that binary tokens with invalid UTF-8 bytes are preserved correctly
337337
// This is the key bug fix: without base64 encoding, these bytes would be corrupted
338338
// when cast to string then JSON encoded (invalid UTF-8 → U+FFFD replacement)
339-
script := writeTestScript(t, `#!/bin/sh
339+
script := writeTestScript(t, `#!/bin/bash
340340
cat > /dev/null
341341
# Output binary data including invalid UTF-8 sequences
342342
# \x80\x81\x82 are invalid UTF-8 continuation bytes without a leading byte
343343
# \xff\xfe are also invalid UTF-8
344+
# Note: Using bash (not sh) because dash doesn't support \x hex escapes
344345
printf '\x80\x81\x82token\xff\xfe'
345346
`)
346347

0 commit comments

Comments
 (0)