|
|
@ -207,50 +207,6 @@ func TestUnsupportedMethodPropfindParity(t *testing.T) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func TestUnsupportedMethodConnectParity(t *testing.T) { |
|
|
|
|
|
if testing.Short() { |
|
|
|
|
|
t.Skip("skipping integration test in short mode") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
clusterHarness := framework.StartVolumeCluster(t, matrix.P2()) |
|
|
|
|
|
conn, grpcClient := framework.DialVolumeServer(t, clusterHarness.VolumeGRPCAddress()) |
|
|
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
|
|
|
|
const volumeID = uint32(85) |
|
|
|
|
|
framework.AllocateVolume(t, grpcClient, volumeID, "") |
|
|
|
|
|
|
|
|
|
|
|
fid := framework.NewFileID(volumeID, 124001, 0x03030303) |
|
|
|
|
|
client := framework.NewHTTPClient() |
|
|
|
|
|
uploadResp := framework.UploadBytes(t, client, clusterHarness.VolumeAdminURL(), fid, []byte("connect-method-check")) |
|
|
|
|
|
_ = framework.ReadAllAndClose(t, uploadResp) |
|
|
|
|
|
if uploadResp.StatusCode != http.StatusCreated { |
|
|
|
|
|
t.Fatalf("upload expected 201, got %d", uploadResp.StatusCode) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
adminReq := mustNewRequest(t, "CONNECT", clusterHarness.VolumeAdminURL()+"/"+fid) |
|
|
|
|
|
adminResp := framework.DoRequest(t, client, adminReq) |
|
|
|
|
|
_ = framework.ReadAllAndClose(t, adminResp) |
|
|
|
|
|
if adminResp.StatusCode != http.StatusBadRequest { |
|
|
|
|
|
t.Fatalf("admin CONNECT expected 400, got %d", adminResp.StatusCode) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
publicReq := mustNewRequest(t, "CONNECT", clusterHarness.VolumePublicURL()+"/"+fid) |
|
|
|
|
|
publicResp := framework.DoRequest(t, client, publicReq) |
|
|
|
|
|
_ = framework.ReadAllAndClose(t, publicResp) |
|
|
|
|
|
if publicResp.StatusCode != http.StatusOK { |
|
|
|
|
|
t.Fatalf("public CONNECT expected passthrough 200, got %d", publicResp.StatusCode) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
verifyResp := framework.ReadBytes(t, client, clusterHarness.VolumeAdminURL(), fid) |
|
|
|
|
|
verifyBody := framework.ReadAllAndClose(t, verifyResp) |
|
|
|
|
|
if verifyResp.StatusCode != http.StatusOK { |
|
|
|
|
|
t.Fatalf("verify GET expected 200, got %d", verifyResp.StatusCode) |
|
|
|
|
|
} |
|
|
|
|
|
if string(verifyBody) != "connect-method-check" { |
|
|
|
|
|
t.Fatalf("CONNECT should not mutate data, got %q", string(verifyBody)) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestPublicPortHeadReadParity(t *testing.T) { |
|
|
func TestPublicPortHeadReadParity(t *testing.T) { |
|
|
if testing.Short() { |
|
|
if testing.Short() { |
|
|
t.Skip("skipping integration test in short mode") |
|
|
t.Skip("skipping integration test in short mode") |
|
|
|