blob: 678afbae7a0401671f7b2f7df81b3fea5f7767da [file] [log] [blame]
Scott Bakerf53bf152019-05-29 17:50:37 -07001/*
2 * Portions copyright 2019-present Open Networking Foundation
3 * Original copyright 2019-present Ciena Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package commands
18
19import (
20 "bytes"
21 "github.com/opencord/cordctl/testutils"
22 "testing"
23)
24
25func TestModelTypeList(t *testing.T) {
26 // use `python -m json.tool` to pretty-print json
27 expected := `AddressPool
28AttWorkflowDriverService
29AttWorkflowDriverServiceInstance
30AttWorkflowDriverWhiteListEntry
31BNGPortMapping
32BackupFile
33BackupOperation
34BandwidthProfile
35ComputeServiceInstance
36FabricCrossconnectService
37FabricCrossconnectServiceInstance
38FabricIpAddress
39FabricService
40Flavor
41Image
42InterfaceType
43KubernetesConfigMap
44KubernetesConfigVolumeMount
45KubernetesData
46KubernetesResourceInstance
47KubernetesSecret
48KubernetesSecretVolumeMount
49KubernetesService
50KubernetesServiceInstance
51NNIPort
52Network
53NetworkParameter
54NetworkParameterType
55NetworkSlice
56NetworkTemplate
57Node
58NodeLabel
59NodeToSwitchPort
60OLTDevice
61ONOSApp
62ONOSService
63ONUDevice
64PONONUPort
65PONPort
66Port
67PortBase
68PortInterface
69Principal
70Privilege
71RCORDIpAddress
72RCORDService
73RCORDSubscriber
74Role
75Service
76ServiceAttribute
77ServiceDependency
78ServiceGraphConstraint
79ServiceInstance
80ServiceInstanceAttribute
81ServiceInstanceLink
82ServiceInterface
83ServicePort
84Site
85Slice
86Switch
87SwitchPort
88Tag
89TrustDomain
90UNIPort
91User
92VOLTService
93VOLTServiceInstance
94XOSCore
95XOSGuiExtension
96`
97
98 got := new(bytes.Buffer)
99 OutputStream = got
100
101 var options ModelTypeOpts
102 err := options.List.Execute([]string{})
103
104 if err != nil {
105 t.Errorf("%s: Received error %v", t.Name(), err)
106 return
107 }
108
109 testutils.AssertStringEqual(t, got.String(), expected)
110}