Scott Baker | f53bf15 | 2019-05-29 17:50:37 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 17 | package commands |
| 18 | |
| 19 | import ( |
| 20 | "bytes" |
Scott Baker | 28a3956 | 2019-07-12 09:34:15 -0700 | [diff] [blame] | 21 | "github.com/opencord/cordctl/pkg/testutils" |
Scott Baker | f53bf15 | 2019-05-29 17:50:37 -0700 | [diff] [blame] | 22 | "testing" |
| 23 | ) |
| 24 | |
| 25 | func TestModelTypeList(t *testing.T) { |
| 26 | // use `python -m json.tool` to pretty-print json |
Scott Baker | d847682 | 2019-06-07 15:12:09 -0700 | [diff] [blame] | 27 | expected := `ANIPort |
| 28 | AddressPool |
Scott Baker | f53bf15 | 2019-05-29 17:50:37 -0700 | [diff] [blame] | 29 | AttWorkflowDriverService |
| 30 | AttWorkflowDriverServiceInstance |
| 31 | AttWorkflowDriverWhiteListEntry |
| 32 | BNGPortMapping |
| 33 | BackupFile |
| 34 | BackupOperation |
| 35 | BandwidthProfile |
| 36 | ComputeServiceInstance |
| 37 | FabricCrossconnectService |
| 38 | FabricCrossconnectServiceInstance |
| 39 | FabricIpAddress |
| 40 | FabricService |
| 41 | Flavor |
| 42 | Image |
| 43 | InterfaceType |
| 44 | KubernetesConfigMap |
| 45 | KubernetesConfigVolumeMount |
| 46 | KubernetesData |
| 47 | KubernetesResourceInstance |
| 48 | KubernetesSecret |
| 49 | KubernetesSecretVolumeMount |
| 50 | KubernetesService |
| 51 | KubernetesServiceInstance |
| 52 | NNIPort |
| 53 | Network |
| 54 | NetworkParameter |
| 55 | NetworkParameterType |
| 56 | NetworkSlice |
| 57 | NetworkTemplate |
| 58 | Node |
| 59 | NodeLabel |
| 60 | NodeToSwitchPort |
| 61 | OLTDevice |
| 62 | ONOSApp |
| 63 | ONOSService |
| 64 | ONUDevice |
Scott Baker | f53bf15 | 2019-05-29 17:50:37 -0700 | [diff] [blame] | 65 | PONPort |
| 66 | Port |
| 67 | PortBase |
| 68 | PortInterface |
| 69 | Principal |
| 70 | Privilege |
| 71 | RCORDIpAddress |
| 72 | RCORDService |
| 73 | RCORDSubscriber |
| 74 | Role |
| 75 | Service |
| 76 | ServiceAttribute |
| 77 | ServiceDependency |
| 78 | ServiceGraphConstraint |
| 79 | ServiceInstance |
| 80 | ServiceInstanceAttribute |
| 81 | ServiceInstanceLink |
| 82 | ServiceInterface |
| 83 | ServicePort |
| 84 | Site |
| 85 | Slice |
| 86 | Switch |
| 87 | SwitchPort |
| 88 | Tag |
Scott Baker | d847682 | 2019-06-07 15:12:09 -0700 | [diff] [blame] | 89 | TechnologyProfile |
Scott Baker | f53bf15 | 2019-05-29 17:50:37 -0700 | [diff] [blame] | 90 | TrustDomain |
| 91 | UNIPort |
| 92 | User |
| 93 | VOLTService |
| 94 | VOLTServiceInstance |
| 95 | XOSCore |
| 96 | XOSGuiExtension |
| 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 | } |