Skip to content

Commit

Permalink
Merge branch 'feature-4.1.3-hp-network-ut@@2' into '4.1.3'
Browse files Browse the repository at this point in the history
[FEATURE: ZSTAC-38238] add AttachL2OvsDpdkNetworkCase ut for high performance network

See merge request zstackio/zstack!1041
  • Loading branch information
zstackio committed Jun 7, 2021
2 parents 572e1d4 + ebfffbd commit b8fbb75
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 46 deletions.
Expand Up @@ -49,6 +49,9 @@ public Result throwExceptionIfError() {
@Param(required = false)
public boolean system = false;

@Param(required = false)
public java.lang.Boolean virtio;

@Param(required = false)
public java.lang.String resourceUuid;

Expand Down
Expand Up @@ -49,6 +49,9 @@ public Result throwExceptionIfError() {
@Param(required = false)
public boolean system = false;

@Param(required = false)
public java.lang.Boolean virtio;

@Param(required = false)
public java.lang.String resourceUuid;

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/org/zstack/sdk/AddImageAction.java
Expand Up @@ -59,7 +59,7 @@ public Result throwExceptionIfError() {
public java.lang.String type;

@Param(required = false, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public boolean virtio = false;
public boolean virtio = true;

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -64,15 +64,15 @@ public Result throwExceptionIfError() {
@Param(required = false, validValues = {"enable","disable"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String aclStatus;

@Param(required = false, validValues = {"tls_cipher_policy_default","tls_cipher_policy_1_0","tls_cipher_policy_1_1","tls_cipher_policy_1_2","tls_cipher_policy_1_2_strict","tls_cipher_policy_1_2_strict_with_1_3"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String securityPolicyType;

@Param(required = false, nonempty = false, nullElements = false, emptyString = true, numberRange = {1L,64L}, noTrim = false)
public java.lang.Integer nbprocess;

@Param(required = false, validValues = {"http-keep-alive","http-server-close","http-tunnel","httpclose","forceclose"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String httpMode;

@Param(required = false, validValues = {"tls_cipher_policy_default","tls_cipher_policy_1_0","tls_cipher_policy_1_1","tls_cipher_policy_1_2","tls_cipher_policy_1_2_strict","tls_cipher_policy_1_2_strict_with_1_3"}, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String securityPolicyType;

@Param(required = false)
public java.util.List systemTags;

Expand Down
Expand Up @@ -46,8 +46,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -43,8 +43,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -40,8 +40,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -43,8 +43,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -46,8 +46,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -40,8 +40,8 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String type;

@Param(required = false, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType;
@Param(required = false, validValues = {"LinuxBridge","OvsDpdk"}, maxLength = 1024, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String vSwitchType = "LinuxBridge";

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
Expand Up @@ -49,6 +49,9 @@ public Result throwExceptionIfError() {
@Param(required = false)
public java.lang.String architecture;

@Param(required = false)
public boolean virtio = true;

@Param(required = false)
public java.lang.String resourceUuid;

Expand Down
Expand Up @@ -50,7 +50,7 @@ public Result throwExceptionIfError() {
public boolean system = false;

@Param(required = false)
public boolean virtio = false;
public boolean virtio = true;

@Param(required = false)
public java.lang.String resourceUuid;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/org/zstack/sdk/UpdateImageAction.java
Expand Up @@ -53,7 +53,7 @@ public Result throwExceptionIfError() {
public java.lang.String architecture;

@Param(required = false, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public boolean virtio = false;
public java.lang.Boolean virtio;

@Param(required = false)
public java.util.List systemTags;
Expand Down
135 changes: 108 additions & 27 deletions testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
Expand Up @@ -17351,6 +17351,33 @@ abstract class ApiHelper {
}


def getLicenseRecords(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetLicenseRecordsAction.class) Closure c) {
def a = new org.zstack.sdk.GetLicenseRecordsAction()

c.resolveStrategy = Closure.OWNER_FIRST
c.delegate = a
c()


if (System.getProperty("apipath") != null) {
if (a.apiId == null) {
a.apiId = Platform.uuid
}

def tracker = new ApiPathTracker(a.apiId)
def out = errorOut(a.call())
def path = tracker.getApiPath()
if (!path.isEmpty()) {
Test.apiPaths[a.class.name] = path.join(" --->\n")
}

return out
} else {
return errorOut(a.call())
}
}


def getLocalRaidPhysicalDriveSmart(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetLocalRaidPhysicalDriveSmartAction.class) Closure c) {
def a = new org.zstack.sdk.GetLocalRaidPhysicalDriveSmartAction()
a.sessionId = Test.currentEnvSpec?.session?.uuid
Expand Down Expand Up @@ -17459,6 +17486,60 @@ abstract class ApiHelper {
}


def getManagementNodeArch(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetManagementNodeArchAction.class) Closure c) {
def a = new org.zstack.sdk.GetManagementNodeArchAction()

c.resolveStrategy = Closure.OWNER_FIRST
c.delegate = a
c()


if (System.getProperty("apipath") != null) {
if (a.apiId == null) {
a.apiId = Platform.uuid
}

def tracker = new ApiPathTracker(a.apiId)
def out = errorOut(a.call())
def path = tracker.getApiPath()
if (!path.isEmpty()) {
Test.apiPaths[a.class.name] = path.join(" --->\n")
}

return out
} else {
return errorOut(a.call())
}
}


def getManagementNodeOS(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetManagementNodeOSAction.class) Closure c) {
def a = new org.zstack.sdk.GetManagementNodeOSAction()

c.resolveStrategy = Closure.OWNER_FIRST
c.delegate = a
c()


if (System.getProperty("apipath") != null) {
if (a.apiId == null) {
a.apiId = Platform.uuid
}

def tracker = new ApiPathTracker(a.apiId)
def out = errorOut(a.call())
def path = tracker.getApiPath()
if (!path.isEmpty()) {
Test.apiPaths[a.class.name] = path.join(" --->\n")
}

return out
} else {
return errorOut(a.call())
}
}


def getMdevDeviceCandidates(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetMdevDeviceCandidatesAction.class) Closure c) {
def a = new org.zstack.sdk.GetMdevDeviceCandidatesAction()
a.sessionId = Test.currentEnvSpec?.session?.uuid
Expand Down Expand Up @@ -18539,6 +18620,33 @@ abstract class ApiHelper {
}


def getUploadImageJobDetails(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetUploadImageJobDetailsAction.class) Closure c) {
def a = new org.zstack.sdk.GetUploadImageJobDetailsAction()
a.sessionId = Test.currentEnvSpec?.session?.uuid
c.resolveStrategy = Closure.OWNER_FIRST
c.delegate = a
c()


if (System.getProperty("apipath") != null) {
if (a.apiId == null) {
a.apiId = Platform.uuid
}

def tracker = new ApiPathTracker(a.apiId)
def out = errorOut(a.call())
def path = tracker.getApiPath()
if (!path.isEmpty()) {
Test.apiPaths[a.class.name] = path.join(" --->\n")
}

return out
} else {
return errorOut(a.call())
}
}


def getUsbDeviceCandidatesForAttachingVm(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetUsbDeviceCandidatesForAttachingVmAction.class) Closure c) {
def a = new org.zstack.sdk.GetUsbDeviceCandidatesForAttachingVmAction()
a.sessionId = Test.currentEnvSpec?.session?.uuid
Expand Down Expand Up @@ -23684,33 +23792,6 @@ abstract class ApiHelper {
}


def getLicenseRecords(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.GetLicenseRecordsAction.class) Closure c) {
def a = new org.zstack.sdk.GetLicenseRecordsAction()

c.resolveStrategy = Closure.OWNER_FIRST
c.delegate = a
c()


if (System.getProperty("apipath") != null) {
if (a.apiId == null) {
a.apiId = Platform.uuid
}

def tracker = new ApiPathTracker(a.apiId)
def out = errorOut(a.call())
def path = tracker.getApiPath()
if (!path.isEmpty()) {
Test.apiPaths[a.class.name] = path.join(" --->\n")
}

return out
} else {
return errorOut(a.call())
}
}


def queryLoadBalancer(@DelegatesTo(strategy = Closure.OWNER_FIRST, value = org.zstack.sdk.QueryLoadBalancerAction.class) Closure c) {
def a = new org.zstack.sdk.QueryLoadBalancerAction()
a.sessionId = Test.currentEnvSpec?.session?.uuid
Expand Down
Expand Up @@ -252,7 +252,7 @@ class KVMSimulator implements Simulator {
}

spec.simulator(KVMConstant.KVM_REALIZE_OVSDPDK_NETWORK_PATH) {
return new KVMAgentCommands.AgentResponse()
return new KVMAgentCommands.CreateBridgeResponse()
}

spec.simulator(KVMConstant.KVM_GENERATE_VDPA_PATH) { HttpEntity<String> e ->
Expand Down
2 changes: 2 additions & 0 deletions testlib/src/main/java/org/zstack/testlib/L2NetworkSpec.groovy
Expand Up @@ -12,6 +12,8 @@ abstract class L2NetworkSpec extends Spec {
String description
@SpecParam(required = true)
String physicalInterface
@SpecParam
String vSwitchType

L2NetworkInventory inventory

Expand Down
Expand Up @@ -27,6 +27,7 @@ class L2NoVlanNetworkSpec extends L2NetworkSpec implements Simulator{
delegate.userTags = userTags
delegate.systemTags = systemTags
delegate.zoneUuid = (parent as ZoneSpec).inventory.uuid
delegate.vSwitchType = vSwitchType
}

postCreate {
Expand Down
Expand Up @@ -27,6 +27,7 @@ class L2VlanNetworkSpec extends L2NetworkSpec implements Simulator{
delegate.systemTags = systemTags
delegate.sessionId = sessionId
delegate.zoneUuid = (parent as ZoneSpec).inventory.uuid
delegate.vSwitchType = vSwitchType
} as L2NetworkInventory

postCreate {
Expand Down

0 comments on commit b8fbb75

Please sign in to comment.