@@ -951,6 +951,37 @@ func (suite *MultiTenantServerTestSuite) TestPerChartLimit() {
951
951
suite .Equal (200 , res .Status (), "200 GET /api/charts/mychart-service-0.0.1" )
952
952
}
953
953
954
+ func (suite * MultiTenantServerTestSuite ) TestPerChartLimitWithFormData () {
955
+ ns := "per-chart-limit"
956
+
957
+ expectUploadFiles := []string {
958
+ testServiceTarballPathV0 ,
959
+ testTarballPathV0 ,
960
+ testTarballPathV2 ,
961
+ testTarballPath ,
962
+ }
963
+
964
+ for _ , f := range expectUploadFiles {
965
+ buf , w := suite .getBodyWithMultipartFormFiles ([]string {"chart" }, []string {f })
966
+ res := suite .doRequest (ns , "POST" , "/api/charts" , buf , w .FormDataContentType ())
967
+ suite .Equal (201 , res .Status (), "201 POST /api/charts" )
968
+ }
969
+
970
+ time .Sleep (time .Second )
971
+
972
+ res := suite .doRequest (ns , "GET" , "/api/charts/mychart/0.2.0" , nil , "" )
973
+ suite .Equal (200 , res .Status (), "200 GET /api/charts/mychart-0.2.0" )
974
+
975
+ res = suite .doRequest (ns , "GET" , "/api/charts/mychart/0.1.0" , nil , "" )
976
+ suite .Equal (200 , res .Status (), "200 GET /api/charts/mychart-0.1.0" )
977
+
978
+ res = suite .doRequest (ns , "GET" , "/api/charts/mychart/0.0.1" , nil , "" )
979
+ suite .Equal (404 , res .Status (), "200 GET /api/charts/mychart-0.0.1" )
980
+
981
+ res = suite .doRequest (ns , "GET" , "/api/charts/mychart-service/0.0.1" , nil , "" )
982
+ suite .Equal (200 , res .Status (), "200 GET /api/charts/mychart-service-0.0.1" )
983
+ }
984
+
954
985
func (suite * MultiTenantServerTestSuite ) TestMaxUploadSizeServer () {
955
986
// trigger 413s, "request too large"
956
987
content , err := os .ReadFile (testTarballPath )
0 commit comments