创建资源池接口测试用例
创建资源池接口测试用例
接口参数描述:
- clusterName String类型,必填字段,表示资源池所在的集群名称
- name String类型,必填字段,表示资源池名称
- namespace String类型,必填字段, 表示资源池所属的命名空间。如果集群限制用户使用的命名空间,则该值必须为cluster namespaceList中值。如果集群不限制用户使用的命名空间,则该值可以是集群上任意命名空间。命名空间取值规范:a-z0-9?且长度不超过63 当namespace在集群中不存在时,会自动在集群中创建该namespace
- quotaType String类型,必填字段,表示资源池上资源Quota的类型,枚举类型,分别是 :volcanoCapabilityQuota、elasticQuota,默认类型elasticQuota
- maxResources String类型,必填字段,表示资源池的资源上限
- minResources String类型,非必填字段, 表示资源池的最小资源保障,当Quota类型为elasticQuota时,必填参数
- schedulingPolicy List
,非必填字段, 表示资源池上任务的排队策略,保留字段 - location Map[String]String,非必填字段, 表示资源池的亲和性,队列与哪些节点绑定,保留字段
测试用例:
-
测试case名称:创建资源池-必填字段缺失
-
测试步骤:
- 将clusterName参数设为空。
- 将name参数设为空。
- 将namespace参数设为空。
- 将quotaType参数设为空。
- 将maxResources参数设为空。
- 发送请求。
-
预期结果:
- 返回状态码400,返回信息包含'clusterName参数为必填字段'。
- 返回状态码400,返回信息包含'name参数为必填字段'。
- 返回状态码400,返回信息包含'namespace参数为必填字段'。
- 返回状态码400,返回信息包含'quotaType参数为必填字段'。
- 返回状态码400,返回信息包含'maxResources参数为必填字段'。
-
-
测试case名称:创建资源池-成功创建
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'test_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 发送请求。
-
预期结果:
- 返回状态码200。
- 返回信息中包含'资源池创建成功'。
- 能够在'test_cluster'集群中找到名称为'test_pool'的资源池。
- 能够在'test_cluster'集群中找到名称为'test_namespace'的命名空间。
-
-
测试case名称:创建资源池-命名空间不存在自动创建
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'new_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 发送请求。
-
预期结果:
- 返回状态码200。
- 返回信息中包含'资源池创建成功'。
- 能够在'test_cluster'集群中找到名称为'test_pool'的资源池。
- 能够在'test_cluster'集群中找到名称为'new_namespace'的命名空间。
-
-
测试case名称:创建资源池-命名空间不存在且命名空间名称非法
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'invalid_@_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 发送请求。
-
预期结果:
- 返回状态码400,返回信息包含'namespace参数格式不合法'。
-
-
测试case名称:创建资源池-Quota类型为volcanoCapabilityQuota
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'test_namespace'。
- 设置quotaType参数为'volcanoCapabilityQuota'。
- 设置maxResources参数为'100'。
- 发送请求。
-
预期结果:
- 返回状态码200。
- 返回信息中包含'资源池创建成功'。
- 能够在'test_cluster'集群中找到名称为'test_pool'的资源池。
- 资源池上的资源Quota类型为'volcanoCapabilityQuota'。
-
-
测试case名称:创建资源池-Quota类型为elasticQuota且minResources参数为空
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'test_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 发送请求。
-
预期结果:
- 返回状态码400,返回信息包含'minResources参数为必填字段'。
-
-
测试case名称:创建资源池-Quota类型为elasticQuota且minResources参数为非数字
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'test_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 将minResources参数设为'abc'。
- 发送请求。
-
预期结果:
- 返回状态码400,返回信息包含'minResources参数格式不合法'。
-
-
测试case名称:创建资源池-Quota类型为elasticQuota且minResources参数为数字
-
测试步骤:
- 设置clusterName参数为'test_cluster'。
- 设置name参数为'test_pool'。
- 设置namespace参数为'test_namespace'。
- 设置quotaType参数为'elasticQuota'。
- 设置maxResources参数为'100'。
- 将minResources参数设为'50'。
- 发送请求。
-
预期结果:
- 返回状态码200。
- 返回信息中包含'资源池创建成功'。
- 能够在'test_cluster'集群中找到名称为'test_pool'的资源池。
- 资源池上的最小资源保障为50。
-
原文地址: https://www.cveoy.top/t/topic/nF3f 著作权归作者所有。请勿转载和采集!