donNewtonAlpha | b9b85eb | 2018-08-14 14:28:22 -0400 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2017 the original author or authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package abstract_test |
| 18 | |
| 19 | import ( |
| 20 | "testing" |
| 21 | |
| 22 | "gerrit.opencord.org/abstract-olt/models/abstract" |
| 23 | ) |
| 24 | |
| 25 | func TestChassisUtils_GenerateChassis(t *testing.T) { |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 26 | chassis := abstract.GenerateChassis("MY_CLLI", 1, 1) |
donNewtonAlpha | b9b85eb | 2018-08-14 14:28:22 -0400 | [diff] [blame] | 27 | slot := chassis.Slots[6] |
| 28 | port := slot.Ports[0] |
| 29 | ont := port.Onts[3] |
| 30 | svlan := ont.Svlan |
| 31 | cvlan := ont.Cvlan |
| 32 | if svlan != 98 { // see map doc |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 33 | t.Errorf("SVlan should be 98 and is %d\n", svlan) |
donNewtonAlpha | b9b85eb | 2018-08-14 14:28:22 -0400 | [diff] [blame] | 34 | } |
| 35 | if cvlan != 434 { // see map doc |
donNewtonAlpha | 1d2d681 | 2018-09-14 16:00:02 -0400 | [diff] [blame] | 36 | t.Errorf("CVlan should be 434 and is %d\n", cvlan) |
donNewtonAlpha | b9b85eb | 2018-08-14 14:28:22 -0400 | [diff] [blame] | 37 | } |
donNewtonAlpha | b9b85eb | 2018-08-14 14:28:22 -0400 | [diff] [blame] | 38 | } |