blob: abdc305bece8462761dc36795cd29d30e94b101a [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
Scott Bakerd8476822019-06-07 15:12:09 -070027 expected := `ANIPort
28AddressPool
Scott Bakerf53bf152019-05-29 17:50:37 -070029AttWorkflowDriverService
30AttWorkflowDriverServiceInstance
31AttWorkflowDriverWhiteListEntry
32BNGPortMapping
33BackupFile
34BackupOperation
35BandwidthProfile
36ComputeServiceInstance
37FabricCrossconnectService
38FabricCrossconnectServiceInstance
39FabricIpAddress
40FabricService
41Flavor
42Image
43InterfaceType
44KubernetesConfigMap
45KubernetesConfigVolumeMount
46KubernetesData
47KubernetesResourceInstance
48KubernetesSecret
49KubernetesSecretVolumeMount
50KubernetesService
51KubernetesServiceInstance
52NNIPort
53Network
54NetworkParameter
55NetworkParameterType
56NetworkSlice
57NetworkTemplate
58Node
59NodeLabel
60NodeToSwitchPort
61OLTDevice
62ONOSApp
63ONOSService
64ONUDevice
Scott Bakerf53bf152019-05-29 17:50:37 -070065PONPort
66Port
67PortBase
68PortInterface
69Principal
70Privilege
71RCORDIpAddress
72RCORDService
73RCORDSubscriber
74Role
75Service
76ServiceAttribute
77ServiceDependency
78ServiceGraphConstraint
79ServiceInstance
80ServiceInstanceAttribute
81ServiceInstanceLink
82ServiceInterface
83ServicePort
84Site
85Slice
86Switch
87SwitchPort
88Tag
Scott Bakerd8476822019-06-07 15:12:09 -070089TechnologyProfile
Scott Bakerf53bf152019-05-29 17:50:37 -070090TrustDomain
91UNIPort
92User
93VOLTService
94VOLTServiceInstance
95XOSCore
96XOSGuiExtension
97`
98
99 got := new(bytes.Buffer)
100 OutputStream = got
101
102 var options ModelTypeOpts
103 err := options.List.Execute([]string{})
104
105 if err != nil {
106 t.Errorf("%s: Received error %v", t.Name(), err)
107 return
108 }
109
110 testutils.AssertStringEqual(t, got.String(), expected)
111}