@@ -127,9 +127,14 @@ func TestBoundaryIntegration(t *testing.T) {
127
127
curlCmd := exec .Command ("sudo" , "ip" , "netns" , "exec" , namespaceName ,
128
128
"env" , "SSL_CERT_FILE=/home/coder/.config/coder_boundary/ca-cert.pem" , "curl" , "-s" , "https://dev.coder.com/api/v2" )
129
129
130
- // Capture output
130
+ // Capture stderr separately
131
+ var stderr bytes.Buffer
132
+ curlCmd .Stderr = & stderr
131
133
output , err := curlCmd .Output ()
132
- require .NoError (t , err , "curl command failed" )
134
+
135
+ if err != nil {
136
+ t .Fatalf ("curl command failed: %v, stderr: %s, output: %s" , err , stderr .String (), string (output ))
137
+ }
133
138
134
139
// Verify response contains expected content
135
140
expectedResponse := `{"message":"👋"}
@@ -143,9 +148,14 @@ func TestBoundaryIntegration(t *testing.T) {
143
148
curlCmd := exec .Command ("sudo" , "ip" , "netns" , "exec" , namespaceName ,
144
149
"curl" , "-s" , "http://example.com" )
145
150
146
- // This should fail
151
+ // Capture stderr separately
152
+ var stderr bytes.Buffer
153
+ curlCmd .Stderr = & stderr
147
154
output , err := curlCmd .Output ()
148
- require .NoError (t , err , "curl command failed" )
155
+
156
+ if err != nil {
157
+ t .Fatalf ("curl command failed: %v, stderr: %s, output: %s" , err , stderr .String (), string (output ))
158
+ }
149
159
require .Contains (t , string (output ), "Request Blocked by Boundary" )
150
160
})
151
161
0 commit comments