From d14b10cb8b2f6dfeb7ef5419c0b02e3d109d0f7e Mon Sep 17 00:00:00 2001 From: mcdillson Date: Mon, 4 May 2026 23:41:51 +0000 Subject: [PATCH 01/18] fixed cluster variable for netbox deployment --- netbox.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox.mk b/netbox.mk index 555c2f1..a133554 100644 --- a/netbox.mk +++ b/netbox.mk @@ -23,7 +23,7 @@ ifndef NETBOX_CLUSTER_NAME $(error NETBOX_CLUSTER_NAME is required. Usage: make netbox-deploy-cluster NETBOX_CLUSTER_NAME=cluster-name) endif kind get clusters | grep -q "$(NETBOX_CLUSTER_NAME)" || kind create cluster --name $(NETBOX_CLUSTER_NAME) - kubectl config use-context kind-$(CLUSTER_NAME) + kubectl config use-context kind-$(NETBOX_CLUSTER_NAME) .PHONY: netbox-undeploy netbox-undeploy: ## Undeploy the netbox cluster From f04c13024ee9f36f77e3586fcecb578d610ead41 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Mon, 4 May 2026 23:42:36 +0000 Subject: [PATCH 02/18] added netbox integration test setup --- test.mk | 23 +++++++++++ .../netbox/initializers/device-roles.yaml | 3 ++ .../netbox/initializers/device-types.yaml | 16 ++++++++ .../netbox/initializers/devices.yaml | 36 +++++++++++++++++ .../netbox/initializers/interfaces.yaml | 40 +++++++++++++++++++ .../netbox/initializers/ip-addresses.yaml | 24 +++++++++++ .../netbox/initializers/manufacturers.yaml | 4 ++ .../netbox/initializers/sites.yaml | 2 + test/integration/t2.clab.yaml | 28 +++++++++++++ 9 files changed, 176 insertions(+) create mode 100644 test/integration/netbox/initializers/device-roles.yaml create mode 100644 test/integration/netbox/initializers/device-types.yaml create mode 100644 test/integration/netbox/initializers/devices.yaml create mode 100644 test/integration/netbox/initializers/interfaces.yaml create mode 100644 test/integration/netbox/initializers/ip-addresses.yaml create mode 100644 test/integration/netbox/initializers/manufacturers.yaml create mode 100644 test/integration/netbox/initializers/sites.yaml create mode 100644 test/integration/t2.clab.yaml diff --git a/test.mk b/test.mk index 3497c2b..e998a6a 100644 --- a/test.mk +++ b/test.mk @@ -85,6 +85,29 @@ deploy-test-topology: ## Deploy a test topology for testing undeploy-test-topology: ## Undeploy a test topology for testing sudo containerlab destroy -t test/integration/t1.clab.yaml -c +.PHONY: deploy-test-netbox-instance +deploy-test-netbox-instance: + $(MAKE) netbox-setup \ + NETBOX_CLUSTER_NAME=test-kind \ + NETBOX_PASSWORD=Netbox123 + +.PHONY: deploy-test-netbox-instance +deploy-test-netbox-topology: + sudo containerlab deploy -t test/integration/t2.clab.yaml -c + kubectl port-forward svc/netbox 8082:80 -n netbox --context kind-test-kind --address=0.0.0.0 >/dev/null 2>&1 & + +.PHONY: sync-netbox-test-data +sync-netbox-test-data: + $(MAKE) netbox-sync-data \ + NETBOX_CLUSTER_NAME=test-kind \ + NETBOX_URL=http://localhost:8082 \ + NETBOX_INIT=test/integration/netbox/initializers + +.PHONY: undeploy-test-netbox-instance +undeploy-test-netbox-instance: + $(MAKE) netbox-delete \ + NETBOX_CLUSTER_NAME=test-kind + .PHONY: apply-test-targets apply-test-targets: ## Apply the test targets for testing kubectl apply -f test/integration/resources/targets/profile diff --git a/test/integration/netbox/initializers/device-roles.yaml b/test/integration/netbox/initializers/device-roles.yaml new file mode 100644 index 0000000..9167dab --- /dev/null +++ b/test/integration/netbox/initializers/device-roles.yaml @@ -0,0 +1,3 @@ +- name: Router + slug: router + color: ff0000 diff --git a/test/integration/netbox/initializers/device-types.yaml b/test/integration/netbox/initializers/device-types.yaml new file mode 100644 index 0000000..a6279ed --- /dev/null +++ b/test/integration/netbox/initializers/device-types.yaml @@ -0,0 +1,16 @@ +- model: ixr-d2l + slug: arista-ixr-d2l + manufacturer: + name: Arista +- model: ixr-d2l + slug: nokia-ixr-d2l + manufacturer: + name: Nokia +- model: ixr-d2l-leaf + slug: nokia-ixr-d2l-leaf + manufacturer: + name: Nokia +- model: ixr-d3l + slug: nokia-ixr-d3l + manufacturer: + name: Nokia diff --git a/test/integration/netbox/initializers/devices.yaml b/test/integration/netbox/initializers/devices.yaml new file mode 100644 index 0000000..17ed036 --- /dev/null +++ b/test/integration/netbox/initializers/devices.yaml @@ -0,0 +1,36 @@ +- name: ceos1 + role: + slug: router + manufacturer: + name: Arista + device_type: + slug: arista-ixr-d2l + site: + name: Lab +- name: leaf1 + role: + slug: router + manufacturer: + name: Nokia + device_type: + slug: nokia-ixr-d2l + site: + name: Lab +- name: leaf2 + role: + slug: router + manufacturer: + name: Nokia + device_type: + slug: nokia-ixr-d2l-leaf + site: + name: Lab +- name: spine1 + role: + slug: router + manufacturer: + name: Nokia + device_type: + slug: nokia-ixr-d3l + site: + name: Lab diff --git a/test/integration/netbox/initializers/interfaces.yaml b/test/integration/netbox/initializers/interfaces.yaml new file mode 100644 index 0000000..05e8d24 --- /dev/null +++ b/test/integration/netbox/initializers/interfaces.yaml @@ -0,0 +1,40 @@ +- device: + name: spine1 + name: e1-1 + type: 1000base-t +- device: + name: leaf1 + name: e1-49 + type: 1000base-t +- device: + name: spine1 + name: e1-2 + type: 1000base-t +- device: + name: leaf2 + name: e1-49 + type: 1000base-t +- device: + name: spine1 + name: e1-3 + type: 1000base-t +- device: + name: ceos1 + name: eth1 + type: 1000base-t +- device: + name: spine1 + name: mgmt0 + type: 1000base-t +- device: + name: leaf1 + name: mgmt0 + type: 1000base-t +- device: + name: leaf2 + name: mgmt0 + type: 1000base-t +- device: + name: ceos1 + name: mgmt0 + type: 1000base-t diff --git a/test/integration/netbox/initializers/ip-addresses.yaml b/test/integration/netbox/initializers/ip-addresses.yaml new file mode 100644 index 0000000..de95cc8 --- /dev/null +++ b/test/integration/netbox/initializers/ip-addresses.yaml @@ -0,0 +1,24 @@ +- address: 172.18.1.10/32 + assigned_object: + device: + name: spine1 + name: mgmt0 + status: active + primary: true + dns_name: t2-nodes-spine1 +- address: 172.18.1.11/32 + assigned_object: + device: + name: leaf1 + name: mgmt0 + status: active + primary: true + dns_name: t2-nodes-leaf1 +- address: 172.18.1.12/32 + assigned_object: + device: + name: leaf2 + name: mgmt0 + status: active + primary: true + dns_name: t2-nodes-leaf2 diff --git a/test/integration/netbox/initializers/manufacturers.yaml b/test/integration/netbox/initializers/manufacturers.yaml new file mode 100644 index 0000000..68627af --- /dev/null +++ b/test/integration/netbox/initializers/manufacturers.yaml @@ -0,0 +1,4 @@ +- name: Nokia + slug: nokia +- name: Arista + slug: arista diff --git a/test/integration/netbox/initializers/sites.yaml b/test/integration/netbox/initializers/sites.yaml new file mode 100644 index 0000000..bc8ed18 --- /dev/null +++ b/test/integration/netbox/initializers/sites.yaml @@ -0,0 +1,2 @@ +- name: Lab + slug: lab diff --git a/test/integration/t2.clab.yaml b/test/integration/t2.clab.yaml new file mode 100644 index 0000000..f79f63c --- /dev/null +++ b/test/integration/t2.clab.yaml @@ -0,0 +1,28 @@ +name: t2 + +mgmt: + network: kind + +topology: + defaults: + kind: nokia_srlinux + image: ghcr.io/nokia/srlinux:25.10.1 + + kinds: + nokia_srlinux: + image: ghcr.io/nokia/srlinux:25.10.1 + type: ixr-d2l + + nodes: + spine1: + type: ixr-d3l + mgmt-ipv4: 172.18.1.10 + + leaf1: + mgmt-ipv4: 172.18.1.11 + leaf2: + mgmt-ipv4: 172.18.1.12 + + links: + - endpoints: ["spine1:e1-1", "leaf1:e1-49"] + - endpoints: ["spine1:e1-2", "leaf2:e1-49"] From 765c6edfcd277f9ee17c8f2c65405837bcabdaa5 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Mon, 4 May 2026 23:56:04 +0000 Subject: [PATCH 03/18] renamed sync-test-netbox-data --- test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.mk b/test.mk index e998a6a..a43da30 100644 --- a/test.mk +++ b/test.mk @@ -97,7 +97,7 @@ deploy-test-netbox-topology: kubectl port-forward svc/netbox 8082:80 -n netbox --context kind-test-kind --address=0.0.0.0 >/dev/null 2>&1 & .PHONY: sync-netbox-test-data -sync-netbox-test-data: +sync-test-netbox-data: $(MAKE) netbox-sync-data \ NETBOX_CLUSTER_NAME=test-kind \ NETBOX_URL=http://localhost:8082 \ From 935c49f051a8ed563f8f83e4241cee9caedcb0ed Mon Sep 17 00:00:00 2001 From: mcdillson Date: Mon, 4 May 2026 23:57:29 +0000 Subject: [PATCH 04/18] moved netbox clab topology into netbox folder --- test/integration/{t2.clab.yaml => netbox/netbox.clab.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/integration/{t2.clab.yaml => netbox/netbox.clab.yaml} (100%) diff --git a/test/integration/t2.clab.yaml b/test/integration/netbox/netbox.clab.yaml similarity index 100% rename from test/integration/t2.clab.yaml rename to test/integration/netbox/netbox.clab.yaml From 5fb77005116167e9a691823bd7c36a0b939b17f2 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Mon, 4 May 2026 23:58:50 +0000 Subject: [PATCH 05/18] added targetsource integration resource --- test.mk | 4 ++++ test/integration/resources/targetsources/netbox.yaml | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/integration/resources/targetsources/netbox.yaml diff --git a/test.mk b/test.mk index a43da30..c064825 100644 --- a/test.mk +++ b/test.mk @@ -108,6 +108,10 @@ undeploy-test-netbox-instance: $(MAKE) netbox-delete \ NETBOX_CLUSTER_NAME=test-kind +.PHONY apply-test-targetsources +apply-test-targetsources: + kubectl apply -f test/integration/resources/targetsources + .PHONY: apply-test-targets apply-test-targets: ## Apply the test targets for testing kubectl apply -f test/integration/resources/targets/profile diff --git a/test/integration/resources/targetsources/netbox.yaml b/test/integration/resources/targetsources/netbox.yaml new file mode 100644 index 0000000..0b8fd23 --- /dev/null +++ b/test/integration/resources/targetsources/netbox.yaml @@ -0,0 +1,11 @@ +apiVersion: operator.gnmic.dev/v1alpha1 +kind: TargetSource +metadata: + name: netbox-ts +spec: + provider: + http: + url: http://localhost:8082/targets + targetLabels: + integration-test: netbox + profile: netbox-default \ No newline at end of file From 1c349ae28ee27c502f6c4c4c8b70fa5699dd7629 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Tue, 5 May 2026 00:01:50 +0000 Subject: [PATCH 06/18] added comments + fixed netbox test topology path --- test.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test.mk b/test.mk index c064825..1060623 100644 --- a/test.mk +++ b/test.mk @@ -86,30 +86,34 @@ undeploy-test-topology: ## Undeploy a test topology for testing sudo containerlab destroy -t test/integration/t1.clab.yaml -c .PHONY: deploy-test-netbox-instance -deploy-test-netbox-instance: +deploy-test-netbox-instance: ## Deploy the test netbox instance for testing $(MAKE) netbox-setup \ NETBOX_CLUSTER_NAME=test-kind \ NETBOX_PASSWORD=Netbox123 .PHONY: deploy-test-netbox-instance -deploy-test-netbox-topology: - sudo containerlab deploy -t test/integration/t2.clab.yaml -c +deploy-test-netbox-topology: ## Deploy the netbox test topology for testing + sudo containerlab deploy -t test/integration/netbox/netbox.clab.yaml -c kubectl port-forward svc/netbox 8082:80 -n netbox --context kind-test-kind --address=0.0.0.0 >/dev/null 2>&1 & .PHONY: sync-netbox-test-data -sync-test-netbox-data: +sync-test-netbox-data: ## Sync the netbox instance with the test topology for testing $(MAKE) netbox-sync-data \ NETBOX_CLUSTER_NAME=test-kind \ NETBOX_URL=http://localhost:8082 \ NETBOX_INIT=test/integration/netbox/initializers .PHONY: undeploy-test-netbox-instance -undeploy-test-netbox-instance: +undeploy-test-netbox-instance: ## Undeploy the netbox instance from the test cluster $(MAKE) netbox-delete \ NETBOX_CLUSTER_NAME=test-kind +.PHONY: undeploy-test-netbox-topology +undeploy-test-netbox-topology: ## Undeploy the netbox test topology for testing + sudo containerlab destroy -t test/integration/netbox/netbox.clab.yaml -c + .PHONY apply-test-targetsources -apply-test-targetsources: +apply-test-targetsources: ## Apply the test targetsources for testing kubectl apply -f test/integration/resources/targetsources .PHONY: apply-test-targets From 012a6a5ed4d3db4f74c683306dfdfcdc3961fbbb Mon Sep 17 00:00:00 2001 From: Valentino Diller Date: Mon, 4 May 2026 18:47:33 -0600 Subject: [PATCH 07/18] fixed missing separator --- test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.mk b/test.mk index 1060623..270f846 100644 --- a/test.mk +++ b/test.mk @@ -112,7 +112,7 @@ undeploy-test-netbox-instance: ## Undeploy the netbox instance from the test clu undeploy-test-netbox-topology: ## Undeploy the netbox test topology for testing sudo containerlab destroy -t test/integration/netbox/netbox.clab.yaml -c -.PHONY apply-test-targetsources +.PHONY: apply-test-targetsources apply-test-targetsources: ## Apply the test targetsources for testing kubectl apply -f test/integration/resources/targetsources From 09aaaa4127c135eab4baf64cca1a38a861a39c73 Mon Sep 17 00:00:00 2001 From: Valentino Diller Date: Mon, 4 May 2026 18:49:00 -0600 Subject: [PATCH 08/18] fixed targetProfile key --- test/integration/resources/targetsources/netbox.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/resources/targetsources/netbox.yaml b/test/integration/resources/targetsources/netbox.yaml index 0b8fd23..39ab922 100644 --- a/test/integration/resources/targetsources/netbox.yaml +++ b/test/integration/resources/targetsources/netbox.yaml @@ -8,4 +8,4 @@ spec: url: http://localhost:8082/targets targetLabels: integration-test: netbox - profile: netbox-default \ No newline at end of file + targetProfile: netbox-default \ No newline at end of file From b9ab471f42d6348c83638e993b29809ec4bbf5d4 Mon Sep 17 00:00:00 2001 From: Valentino Diller Date: Tue, 5 May 2026 08:27:45 -0600 Subject: [PATCH 09/18] eliminated recursive make calls --- test.mk | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/test.mk b/test.mk index 270f846..b2d550e 100644 --- a/test.mk +++ b/test.mk @@ -4,6 +4,8 @@ GNMIC_VERSION ?= 0.44.1 KUBECTL_VERSION ?= v1.31.0 TEST_CLUSTER_NAME ?= test-kind CERT_MANAGER_VERSION ?= v1.19.3 +NETBOX_TEST_PORT ?= 8082 + .PHONY: install-kubectl install-kubectl: ## Install kubectl if not present @@ -86,27 +88,24 @@ undeploy-test-topology: ## Undeploy a test topology for testing sudo containerlab destroy -t test/integration/t1.clab.yaml -c .PHONY: deploy-test-netbox-instance -deploy-test-netbox-instance: ## Deploy the test netbox instance for testing - $(MAKE) netbox-setup \ - NETBOX_CLUSTER_NAME=test-kind \ - NETBOX_PASSWORD=Netbox123 +deploy-test-netbox-instance: NETBOX_CLUSTER_NAME=$(TEST_CLUSTER_NAME) ## Deploy the test netbox instance for testing +deploy-test-netbox-instance: NETBOX_PASSWORD=Netbox123 +deploy-test-netbox-instance: netbox-setup .PHONY: deploy-test-netbox-instance deploy-test-netbox-topology: ## Deploy the netbox test topology for testing sudo containerlab deploy -t test/integration/netbox/netbox.clab.yaml -c - kubectl port-forward svc/netbox 8082:80 -n netbox --context kind-test-kind --address=0.0.0.0 >/dev/null 2>&1 & + kubectl port-forward svc/netbox $(NETBOX_TEST_PORT):80 -n netbox --context kind-$(TEST_CLUSTER_NAME) --address=0.0.0.0 >/dev/null 2>&1 & .PHONY: sync-netbox-test-data -sync-test-netbox-data: ## Sync the netbox instance with the test topology for testing - $(MAKE) netbox-sync-data \ - NETBOX_CLUSTER_NAME=test-kind \ - NETBOX_URL=http://localhost:8082 \ - NETBOX_INIT=test/integration/netbox/initializers +sync-test-netbox-data: NETBOX_CLUSTER_NAME=$(TEST_CLUSTER_NAME) ## Sync the netbox instance with the test topology for testing +sync-test-netbox-data: NETBOX_URL=http://localhost:$(NETBOX_TEST_PORT) +sync-test-netbox-data: NETBOX_INIT=test/integration/netbox/initializers +sync-test-netbox-data: netbox-sync-data .PHONY: undeploy-test-netbox-instance -undeploy-test-netbox-instance: ## Undeploy the netbox instance from the test cluster - $(MAKE) netbox-delete \ - NETBOX_CLUSTER_NAME=test-kind +undeploy-test-netbox-instance: NETBOX_CLUSTER_NAME=$(TEST_CLUSTER_NAME) ## Undeploy the netbox instance from the test cluster +undeploy-test-netbox-instance: netbox-delete .PHONY: undeploy-test-netbox-topology undeploy-test-netbox-topology: ## Undeploy the netbox test topology for testing From 1a6239af453bbf8a1d8b12365a531f22671fdbbc Mon Sep 17 00:00:00 2001 From: mcdillson Date: Tue, 5 May 2026 14:32:54 +0000 Subject: [PATCH 10/18] added recursive clab folder to gitignore --- .gitignore | 2 +- test/integration/netbox/netbox.clab.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 29d31af..ee83f89 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,4 @@ notes/ docs/public docs/resources/_gen/ docs/.hugo_build.lock -test/integration/clab-* \ No newline at end of file +test/integration/**/clab-* \ No newline at end of file diff --git a/test/integration/netbox/netbox.clab.yaml b/test/integration/netbox/netbox.clab.yaml index f79f63c..ddd1705 100644 --- a/test/integration/netbox/netbox.clab.yaml +++ b/test/integration/netbox/netbox.clab.yaml @@ -1,4 +1,4 @@ -name: t2 +name: netbox mgmt: network: kind From 4f879aa50cfd86f67ae87b88213ce8aafae53293 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Tue, 5 May 2026 14:34:00 +0000 Subject: [PATCH 11/18] added resources for http static server test --- lab/dev/http/targets.json | 13 ++++++++++ .../integration/http/resources/configmap.yaml | 22 +++++++++++++++++ .../http/resources/deployment.yaml | 24 +++++++++++++++++++ test/integration/http/resources/service.yaml | 10 ++++++++ .../resources/targetsources/http.yaml | 11 +++++++++ 5 files changed, 80 insertions(+) create mode 100644 lab/dev/http/targets.json create mode 100644 test/integration/http/resources/configmap.yaml create mode 100644 test/integration/http/resources/deployment.yaml create mode 100644 test/integration/http/resources/service.yaml create mode 100644 test/integration/resources/targetsources/http.yaml diff --git a/lab/dev/http/targets.json b/lab/dev/http/targets.json new file mode 100644 index 0000000..882faae --- /dev/null +++ b/lab/dev/http/targets.json @@ -0,0 +1,13 @@ +[ + { + "address": "10.0.0.1:57000", + "name": "router1" + }, + { + "address": "10.0.0.2:57000", + "name": "router2", + "labels": { + "test": "asdf" + } + } +] \ No newline at end of file diff --git a/test/integration/http/resources/configmap.yaml b/test/integration/http/resources/configmap.yaml new file mode 100644 index 0000000..0e8b35c --- /dev/null +++ b/test/integration/http/resources/configmap.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: targets-config +data: + targets.json: | + [ + { + "address": "10.0.0.1:57000", + "name": "router1", + "labels": { + "label1": "test" + } + }, + { + "address": "10.0.0.2:57000", + "name": "router2", + "labels": { + "label2": "test2" + } + } + ] \ No newline at end of file diff --git a/test/integration/http/resources/deployment.yaml b/test/integration/http/resources/deployment.yaml new file mode 100644 index 0000000..3dc1f61 --- /dev/null +++ b/test/integration/http/resources/deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: targets-server +spec: + replicas: 1 + selector: + matchLabels: + app: targets-server + template: + metadata: + labels: + app: targets-server + spec: + containers: + - name: nginx + image: nginx:alpine + volumeMounts: + - name: data + mountPath: /usr/share/nginx/html + volumes: + - name: data + configMap: + name: targets-config \ No newline at end of file diff --git a/test/integration/http/resources/service.yaml b/test/integration/http/resources/service.yaml new file mode 100644 index 0000000..03f0efa --- /dev/null +++ b/test/integration/http/resources/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: targets +spec: + selector: + app: targets-server + ports: + - port: 80 + targetPort: 80 \ No newline at end of file diff --git a/test/integration/resources/targetsources/http.yaml b/test/integration/resources/targetsources/http.yaml new file mode 100644 index 0000000..199fcf3 --- /dev/null +++ b/test/integration/resources/targetsources/http.yaml @@ -0,0 +1,11 @@ +apiVersion: operator.gnmic.dev/v1alpha1 +kind: TargetSource +metadata: + name: http-ts +spec: + provider: + http: + url: http://targets.default.svc/targets.json + targetLabels: + integration-test: http + targetProfile: http-default \ No newline at end of file From a53440605e5345b20c2182c67fe5e3b2d0ea32c8 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Tue, 5 May 2026 14:38:25 +0000 Subject: [PATCH 12/18] added make targets for http testing pod --- test.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test.mk b/test.mk index b2d550e..f92c4ec 100644 --- a/test.mk +++ b/test.mk @@ -87,6 +87,14 @@ deploy-test-topology: ## Deploy a test topology for testing undeploy-test-topology: ## Undeploy a test topology for testing sudo containerlab destroy -t test/integration/t1.clab.yaml -c +.PHONY: deploy-test-http-server +deploy-test-http-server: ## Deploy a test http pod with a static file inventory for testing + kubectl apply -f test/integration/http/resources/ + +.PHONY: undeploy-test-http-server +undeploy-test-http-server: ## Undeploy the http pod for testing + kubectl delete -f test/integration/http/resources/ + .PHONY: deploy-test-netbox-instance deploy-test-netbox-instance: NETBOX_CLUSTER_NAME=$(TEST_CLUSTER_NAME) ## Deploy the test netbox instance for testing deploy-test-netbox-instance: NETBOX_PASSWORD=Netbox123 From 9ff3ba1a2fdaea9630c0049c106b22bca5d91186 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 20:53:05 +0000 Subject: [PATCH 13/18] fixed make target name --- test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.mk b/test.mk index f92c4ec..23c5983 100644 --- a/test.mk +++ b/test.mk @@ -100,7 +100,7 @@ deploy-test-netbox-instance: NETBOX_CLUSTER_NAME=$(TEST_CLUSTER_NAME) ## Deploy deploy-test-netbox-instance: NETBOX_PASSWORD=Netbox123 deploy-test-netbox-instance: netbox-setup -.PHONY: deploy-test-netbox-instance +.PHONY: deploy-test-netbox-topology deploy-test-netbox-topology: ## Deploy the netbox test topology for testing sudo containerlab deploy -t test/integration/netbox/netbox.clab.yaml -c kubectl port-forward svc/netbox $(NETBOX_TEST_PORT):80 -n netbox --context kind-$(TEST_CLUSTER_NAME) --address=0.0.0.0 >/dev/null 2>&1 & From 000d405b8413e545534f86fabed9906948ac775e Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 20:56:16 +0000 Subject: [PATCH 14/18] changed resource names + mapped target inventory to clab --- .../integration/http/resources/configmap.yaml | 24 +++++++++++++------ .../http/resources/deployment.yaml | 8 +++---- test/integration/http/resources/service.yaml | 4 ++-- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/test/integration/http/resources/configmap.yaml b/test/integration/http/resources/configmap.yaml index 0e8b35c..f017566 100644 --- a/test/integration/http/resources/configmap.yaml +++ b/test/integration/http/resources/configmap.yaml @@ -1,22 +1,32 @@ apiVersion: v1 kind: ConfigMap metadata: - name: targets-config + name: http-target-cfg data: targets.json: | [ { - "address": "10.0.0.1:57000", - "name": "router1", + "address": "clab-t1-spine1:57400", + "name": "spine1", "labels": { - "label1": "test" + "vendor": "nokia_srlinux", + "role": "spine" } }, { - "address": "10.0.0.2:57000", - "name": "router2", + "address": "clab-t1-leaf1:57400", + "name": "leaf1", "labels": { - "label2": "test2" + "vendor": "nokia_srlinux", + "role": "leaf" + } + }, + { + "address": "clab-t1-leaf2:57400", + "name": "leaf2", + "labels": { + "vendor": "nokia_srlinux", + "role": "leaf" } } ] \ No newline at end of file diff --git a/test/integration/http/resources/deployment.yaml b/test/integration/http/resources/deployment.yaml index 3dc1f61..785c1e3 100644 --- a/test/integration/http/resources/deployment.yaml +++ b/test/integration/http/resources/deployment.yaml @@ -1,16 +1,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: targets-server + name: http-target-inv spec: replicas: 1 selector: matchLabels: - app: targets-server + app: http-target-inv template: metadata: labels: - app: targets-server + app: http-target-inv spec: containers: - name: nginx @@ -21,4 +21,4 @@ spec: volumes: - name: data configMap: - name: targets-config \ No newline at end of file + name: http-target-cfg \ No newline at end of file diff --git a/test/integration/http/resources/service.yaml b/test/integration/http/resources/service.yaml index 03f0efa..d4be4e7 100644 --- a/test/integration/http/resources/service.yaml +++ b/test/integration/http/resources/service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: targets + name: http-svc spec: selector: - app: targets-server + app: http-target-inv ports: - port: 80 targetPort: 80 \ No newline at end of file From 858600b8bdcd1824ddde80eb397f3bdb26a5ff6b Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 20:57:11 +0000 Subject: [PATCH 15/18] fixed http target url and profile --- test/integration/resources/targetsources/http.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/resources/targetsources/http.yaml b/test/integration/resources/targetsources/http.yaml index 199fcf3..422cfdc 100644 --- a/test/integration/resources/targetsources/http.yaml +++ b/test/integration/resources/targetsources/http.yaml @@ -5,7 +5,7 @@ metadata: spec: provider: http: - url: http://targets.default.svc/targets.json + url: http://http-svc.default.svc/targets.json targetLabels: - integration-test: http - targetProfile: http-default \ No newline at end of file + integrationtest: http + targetProfile: default \ No newline at end of file From bbbceec02e540df17102ccd4503679ce5795993e Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 20:57:37 +0000 Subject: [PATCH 16/18] removed netbox targetsource for integration test --- test/integration/resources/targetsources/netbox.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/integration/resources/targetsources/netbox.yaml diff --git a/test/integration/resources/targetsources/netbox.yaml b/test/integration/resources/targetsources/netbox.yaml deleted file mode 100644 index 39ab922..0000000 --- a/test/integration/resources/targetsources/netbox.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: operator.gnmic.dev/v1alpha1 -kind: TargetSource -metadata: - name: netbox-ts -spec: - provider: - http: - url: http://localhost:8082/targets - targetLabels: - integration-test: netbox - targetProfile: netbox-default \ No newline at end of file From bfaf0e3e2e32361ee97343cccfa4f4ad717e1256 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 20:58:09 +0000 Subject: [PATCH 17/18] mapped operator resources to new http test --- test/integration/resources/clusters/cluster1.yaml | 2 +- test/integration/resources/pipelines/pipeline1.yaml | 2 ++ test/integration/resources/pipelines/pipeline2.yaml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/resources/clusters/cluster1.yaml b/test/integration/resources/clusters/cluster1.yaml index 513b948..c01cc56 100644 --- a/test/integration/resources/clusters/cluster1.yaml +++ b/test/integration/resources/clusters/cluster1.yaml @@ -13,4 +13,4 @@ spec: memory: "500Mi" cpu: "1" targetDistribution: - podCapacity: 5 \ No newline at end of file + podCapacity: 10 \ No newline at end of file diff --git a/test/integration/resources/pipelines/pipeline1.yaml b/test/integration/resources/pipelines/pipeline1.yaml index 0dc67a3..82c0289 100644 --- a/test/integration/resources/pipelines/pipeline1.yaml +++ b/test/integration/resources/pipelines/pipeline1.yaml @@ -12,6 +12,8 @@ spec: - matchLabels: vendor: nokia_srlinux role: spine + - matchLabels: + operator.gnmic.dev/targetsource: http-ts subscriptionSelectors: - matchLabels: vendor: nokia_srlinux diff --git a/test/integration/resources/pipelines/pipeline2.yaml b/test/integration/resources/pipelines/pipeline2.yaml index 7420d7d..a361833 100644 --- a/test/integration/resources/pipelines/pipeline2.yaml +++ b/test/integration/resources/pipelines/pipeline2.yaml @@ -12,6 +12,8 @@ spec: - matchLabels: vendor: nokia_srlinux role: spine + - matchLabels: + operator.gnmic.dev/targetsource: http-ts subscriptionSelectors: - matchLabels: vendor: nokia_srlinux From f7e6ac0f340f8ef39cb220d94db2ded103088a97 Mon Sep 17 00:00:00 2001 From: mcdillson Date: Fri, 8 May 2026 21:00:08 +0000 Subject: [PATCH 18/18] removed netbox clab and changed address --- .../netbox/initializers/ip-addresses.yaml | 6 ++-- test/integration/netbox/netbox.clab.yaml | 28 ------------------- 2 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 test/integration/netbox/netbox.clab.yaml diff --git a/test/integration/netbox/initializers/ip-addresses.yaml b/test/integration/netbox/initializers/ip-addresses.yaml index de95cc8..73453a8 100644 --- a/test/integration/netbox/initializers/ip-addresses.yaml +++ b/test/integration/netbox/initializers/ip-addresses.yaml @@ -1,4 +1,4 @@ -- address: 172.18.1.10/32 +- address: clab-t1-spine1 assigned_object: device: name: spine1 @@ -6,7 +6,7 @@ status: active primary: true dns_name: t2-nodes-spine1 -- address: 172.18.1.11/32 +- address: clab-t1-leaf1 assigned_object: device: name: leaf1 @@ -14,7 +14,7 @@ status: active primary: true dns_name: t2-nodes-leaf1 -- address: 172.18.1.12/32 +- address: clab-t1-leaf2 assigned_object: device: name: leaf2 diff --git a/test/integration/netbox/netbox.clab.yaml b/test/integration/netbox/netbox.clab.yaml deleted file mode 100644 index ddd1705..0000000 --- a/test/integration/netbox/netbox.clab.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: netbox - -mgmt: - network: kind - -topology: - defaults: - kind: nokia_srlinux - image: ghcr.io/nokia/srlinux:25.10.1 - - kinds: - nokia_srlinux: - image: ghcr.io/nokia/srlinux:25.10.1 - type: ixr-d2l - - nodes: - spine1: - type: ixr-d3l - mgmt-ipv4: 172.18.1.10 - - leaf1: - mgmt-ipv4: 172.18.1.11 - leaf2: - mgmt-ipv4: 172.18.1.12 - - links: - - endpoints: ["spine1:e1-1", "leaf1:e1-49"] - - endpoints: ["spine1:e1-2", "leaf2:e1-49"]