aboutsummaryrefslogtreecommitdiffstats
path: root/src/ncm/api/chainhandler_test.go
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-05-28 17:07:20 -0700
committerEric Multanen <eric.w.multanen@intel.com>2020-06-02 14:00:07 -0700
commitad7782cbf83c11f152a6457f3808a4da99a1ae56 (patch)
treee88276d8f0d55bd58a903d1c31ab4e43e4011193 /src/ncm/api/chainhandler_test.go
parentc257a136355a794f5bf778f670c041e8958c3608 (diff)
Create OVN network action controller from ncm
Split out part of ncm microservice to act as the Onv4k8s network action controller for the orchestrator. No code changes really - just moving around to fit the architectural plan. Issue-ID: MULTICLOUD-1029 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com> Change-Id: I17292ac72d041050269f05fc4a0c2a6ca741aeb5
Diffstat (limited to 'src/ncm/api/chainhandler_test.go')
-rw-r--r--src/ncm/api/chainhandler_test.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/ncm/api/chainhandler_test.go b/src/ncm/api/chainhandler_test.go
deleted file mode 100644
index f13a90c4..00000000
--- a/src/ncm/api/chainhandler_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2020 Intel Corporation, Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package api
-
-import (
- "testing"
-)
-
-func TestIsValidNetworkChain(t *testing.T) {
- t.Run("Valid Chains", func(t *testing.T) {
- validchains := []string{
- "app=abc,net1,app=xyz",
- "app=abc, net1, app=xyz",
- " app=abc , net1 , app=xyz ",
- "app.kubernets.io/name=abc,net1,app.kubernets.io/name=xyz",
- "app.kubernets.io/name=abc,net1,app.kubernets.io/name=xyz, net2, anotherlabel=wex",
- }
- for _, chain := range validchains {
- err := validateNetworkChain(chain)
- if err != nil {
- t.Errorf("Valid network chain failed to pass: %v %v", chain, err)
- }
- }
- })
-
- t.Run("Invalid Chains", func(t *testing.T) {
- invalidchains := []string{
- "",
- "app=abc,net1,app= xyz",
- "app=abc,net1,xyz",
- "app=abc,net1",
- "app.kubernets.io/name=abc,net1,=xyz",
- "abcdefg",
- }
- for _, chain := range invalidchains {
- err := validateNetworkChain(chain)
- if err == nil {
- t.Errorf("Invalid network chain passed: %v", chain)
- }
- }
- })
-}