Skip to content

Commit

Permalink
Merge pull request #138 from srl-labs/test/more-e2e-testing
Browse files Browse the repository at this point in the history
test: more and more meaingful e2e test for basic c9s functionality
  • Loading branch information
carlmontanari authored Mar 27, 2024
2 parents f2440ea + 1fb588e commit b91c0c1
Show file tree
Hide file tree
Showing 17 changed files with 924 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/vars.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GO_VERSION=1.22
DEVSPACE_VERSION=v6.3.11
DEVSPACE_VERSION=v6.3.12
GCI_VERSION=v0.12.3
GOFUMPT_VERSION=v0.6.0
GOLANGCI_LINT_VERSION=v1.56.2
GOLANGCI_LINT_VERSION=v1.57.1
GOLINES_VERSION=v0.12.2
GOTESTSUM_VERSION=v1.11.0
HELM_VERSION=v3.14.2
8 changes: 8 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:

- name: spin up kind cluster
uses: helm/[email protected]
with:
version: v0.22.0

- name: verify kind cluster
run: |
Expand All @@ -105,6 +107,12 @@ jobs:
- name: deploy clabernetes
run: devspace run deploy --profile debug

# actions seem to be running out of disk for e2e -- probably due to all the image build stuff
# floating around, all the junk runners get pre-built with, and runners not being super beefy
# lets just system prune all the docker stuff to get rid of some junk we dont need
- name: docker system prune
run: docker system prune -a -f

- name: setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_e2e }}
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ issues:
# prefer to sprintf -- feels more consistent overall
- linters:
- perfsprint
text: "can be replaced with string addition"
text: "can be replaced with string concatenation"

run:
go: '1.21'
Expand All @@ -189,4 +189,4 @@ output:
uniq-by-line: false

service:
golangci-lint-version: 1.56.x
golangci-lint-version: 1.57.x
2 changes: 1 addition & 1 deletion e2e/clabverter/clabverter_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ func TestClabverterBasic(t *testing.T) {
},
}

clabernetestesthelpersuite.Run(t, steps, namespace)
clabernetestesthelpersuite.Run(t, testName, steps, namespace)
}
20 changes: 20 additions & 0 deletions e2e/topology/basic/test-fixtures/20-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Topology
metadata:
name: topology-basic
spec:
definition:
containerlab: |-
name: topology-basic
topology:
nodes:
srl1:
kind: srl
image: ghcr.io/nokia/srlinux
srl2:
kind: srl
image: ghcr.io/nokia/srlinux
links:
- endpoints: ["srl1:e1-1", "srl2:e1-1"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Connectivity
metadata:
labels:
clabernetes/app: clabernetes
clabernetes/name: topology-basic
clabernetes/topologyKind: containerlab
clabernetes/topologyOwner: topology-basic
name: topology-basic
namespace: NAMESPACE
ownerReferences:
- apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Topology
name: topology-basic
spec:
pointToPointTunnels: {}
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
app.kubernetes.io/name: topology-basic-srl1
clabernetes/app: clabernetes
clabernetes/name: topology-basic-srl1
clabernetes/topologyNode: srl1
clabernetes/topologyOwner: topology-basic
name: topology-basic-srl1
namespace: NAMESPACE
ownerReferences:
- apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Topology
name: topology-basic
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
app.kubernetes.io/name: topology-basic-srl1
clabernetes/app: clabernetes
clabernetes/name: topology-basic-srl1
clabernetes/topologyNode: srl1
clabernetes/topologyOwner: topology-basic
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: topology-basic-srl1
clabernetes/app: clabernetes
clabernetes/name: topology-basic-srl1
clabernetes/topologyNode: srl1
clabernetes/topologyOwner: topology-basic
spec:
containers:
- command:
- /clabernetes/manager
- launch
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: APP_NAME
value: clabernetes
- name: MANAGER_NAMESPACE
value: clabernetes
- name: LAUNCHER_CRI_KIND
value: containerd
- name: LAUNCHER_IMAGE_PULL_THROUGH_MODE
value: auto
- name: LAUNCHER_LOGGER_LEVEL
value: debug
- name: LAUNCHER_TOPOLOGY_NAME
value: topology-basic
- name: LAUNCHER_NODE_NAME
value: srl1
- name: LAUNCHER_NODE_IMAGE
value: ghcr.io/nokia/srlinux
- name: LAUNCHER_CONNECTIVITY_KIND
value: vxlan
- name: LAUNCHER_CONTAINERLAB_VERSION
- name: LAUNCHER_CONTAINERLAB_TIMEOUT
- name: LAUNCHER_PRIVILEGED
value: "true"
imagePullPolicy: IfNotPresent
name: srl1
ports:
- containerPort: 14789
name: vxlan
protocol: UDP
- containerPort: 4799
name: slurpeeth
protocol: TCP
resources:
requests:
cpu: 200m
memory: 512Mi
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /clabernetes/topo.clab.yaml
name: topology-basic-config
readOnly: true
subPath: srl1
- mountPath: /clabernetes/files-from-url.yaml
name: topology-basic-config
readOnly: true
subPath: srl1-files-from-url
- mountPath: /clabernetes/configured-pull-secrets.yaml
name: topology-basic-config
readOnly: true
subPath: configured-pull-secrets
- mountPath: /clabernetes/.node/containerd.sock
name: cri-sock
readOnly: true
subPath: containerd.sock
workingDir: /clabernetes
dnsPolicy: ClusterFirst
hostname: srl1
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: clabernetes-launcher-service-account
serviceAccountName: clabernetes-launcher-service-account
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 493
name: topology-basic
name: topology-basic-config
- hostPath:
path: /run/containerd
type: ""
name: cri-sock
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1
kind: Service
metadata:
labels:
clabernetes/app: clabernetes
clabernetes/name: topology-basic-srl1
clabernetes/topologyKind: containerlab
clabernetes/topologyNode: srl1
clabernetes/topologyOwner: topology-basic
clabernetes/topologyServiceType: fabric
name: topology-basic-srl1-vx
namespace: NAMESPACE
ownerReferences:
- apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Topology
name: topology-basic
spec:
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: vxlan
port: 14789
protocol: UDP
targetPort: 14789
- name: slurpeeth
port: 4799
protocol: TCP
targetPort: 4799
selector:
clabernetes/app: clabernetes
clabernetes/name: topology-basic-srl1
clabernetes/topologyNode: srl1
clabernetes/topologyOwner: topology-basic
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: clabernetes.containerlab.dev/v1alpha1
kind: Connectivity
metadata:
labels:
clabernetes/app: clabernetes
clabernetes/name: topology-basic
clabernetes/topologyKind: containerlab
clabernetes/topologyOwner: topology-basic
name: topology-basic
namespace: NAMESPACE
spec:
pointToPointTunnels:
srl1:
- destination: topology-basic-srl2-vx.NAMESPACE.svc.cluster.local
localInterface: e1-1
localNode: srl1
remoteInterface: e1-1
remoteNode: srl2
tunnelID: 1
srl2:
- destination: topology-basic-srl1-vx.NAMESPACE.svc.cluster.local
localInterface: e1-1
localNode: srl2
remoteInterface: e1-1
remoteNode: srl1
tunnelID: 1
status: {}
Loading

0 comments on commit b91c0c1

Please sign in to comment.