-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add e2e test cases for hypernode
Signed-off-by: xuwentao <[email protected]>
- Loading branch information
Showing
11 changed files
with
632 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package hypernode | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestE2E(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Volcano Network Topology Test Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-0 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-0 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-1 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-1 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-2 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-2 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-3 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-3 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-4 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-4 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-5 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-5 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-6 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-6 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
allocatable: | ||
cpu: "4" | ||
memory: "4Gi" | ||
pods: "110" | ||
--- | ||
apiVersion: v1 | ||
kind: Node | ||
metadata: | ||
annotations: | ||
node.alpha.kubernetes.io/ttl: "0" | ||
kwok.x-k8s.io/node: fake | ||
labels: | ||
beta.kubernetes.io/arch: amd64 | ||
beta.kubernetes.io/os: linux | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/hostname: kwok-node-7 | ||
kubernetes.io/os: linux | ||
kubernetes.io/role: agent | ||
node-role.kubernetes.io/agent: "" | ||
type: kwok | ||
name: kwok-node-7 | ||
spec: | ||
taints: # Avoid scheduling actual running pods to fake Node | ||
- effect: NoSchedule | ||
key: kwok.x-k8s.io/node | ||
value: fake | ||
status: | ||
capacity: | ||
cpu: "2" | ||
memory: "4Gi" | ||
allocatable: | ||
cpu: "2" | ||
memory: "4Gi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package hypernode | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"k8s.io/client-go/kubernetes" | ||
"k8s.io/client-go/tools/clientcmd" | ||
|
||
vcclient "volcano.sh/apis/pkg/client/clientset/versioned" | ||
e2eutil "volcano.sh/volcano/test/e2e/util" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
home := e2eutil.HomeDir() | ||
configPath := e2eutil.KubeconfigPath(home) | ||
config, _ := clientcmd.BuildConfigFromFlags(e2eutil.MasterURL(), configPath) | ||
e2eutil.VcClient = vcclient.NewForConfigOrDie(config) | ||
e2eutil.KubeClient = kubernetes.NewForConfigOrDie(config) | ||
os.Exit(m.Run()) | ||
} |
Oops, something went wrong.