Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 core |
| 18 | |
| 19 | import ( |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 20 | "flag" |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 21 | "os" |
| 22 | "os/signal" |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 23 | "reflect" |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 24 | "strconv" |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 25 | "strings" |
| 26 | "sync" |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 27 | "syscall" |
Mahir Gunyel | 32dfd72 | 2019-08-05 16:18:06 +0300 | [diff] [blame] | 28 | "time" |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 29 | |
Zack Williams | 2abf393 | 2019-08-05 14:07:05 -0700 | [diff] [blame] | 30 | "github.com/opencord/voltha-bbsim/common/logger" |
| 31 | "github.com/opencord/voltha-bbsim/device" |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 32 | log "github.com/sirupsen/logrus" |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 33 | ) |
| 34 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 35 | // Constants for tester mode |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 36 | const ( |
| 37 | DEFAULT Mode = iota |
| 38 | AAA |
| 39 | BOTH |
| 40 | ) |
| 41 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 42 | // Mode store emulation mode |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 43 | type Mode int |
| 44 | |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 45 | // AutoONUActivate is flag for Auto ONU Add on/off. |
| 46 | var AutoONUActivate int |
| 47 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 48 | //Option is the structure to store the user provided flag values |
| 49 | type Option struct { |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 50 | address string |
| 51 | port uint32 |
| 52 | mgmtGrpcPort uint32 |
| 53 | mgmtRestPort uint32 |
| 54 | oltid uint32 |
| 55 | npon uint32 |
| 56 | nonus uint32 |
| 57 | aaawait int |
| 58 | dhcpwait int |
| 59 | dhcpservip string |
Mahir Gunyel | 32dfd72 | 2019-08-05 16:18:06 +0300 | [diff] [blame] | 60 | intvl time.Duration |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 61 | interactiveOnuActivation bool |
| 62 | Mode Mode |
| 63 | KafkaBroker string |
| 64 | Debuglvl string |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 65 | } |
| 66 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 67 | // GetOptions receives command line options and stores them in Option structure |
| 68 | func GetOptions() *Option { |
| 69 | o := new(Option) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 70 | addressport := flag.String("H", ":50060", "IP address:port") |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 71 | oltid := flag.Int("id", 0, "OLT-ID") |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 72 | npon := flag.Int("i", 1, "Number of PON-IF ports") |
| 73 | nonus := flag.Int("n", 1, "Number of ONUs per PON-IF port") |
| 74 | modeopt := flag.String("m", "default", "Emulation mode (default, aaa, both (aaa & dhcp))") |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 75 | aaawait := flag.Int("aw", 2, "Wait time (sec) for activation WPA supplicants after EAPOL flow entry installed") |
| 76 | dhcpwait := flag.Int("dw", 2, "Wait time (sec) for activation DHCP clients after DHCP flow entry installed") |
Keita NISHIMOTO | 2f8a6a4 | 2019-02-08 09:47:07 +0900 | [diff] [blame] | 77 | dhcpservip := flag.String("s", "182.21.0.128", "DHCP Server IP Address") |
Mahir Gunyel | 32dfd72 | 2019-08-05 16:18:06 +0300 | [diff] [blame] | 78 | intvl := flag.Duration("v", 0, "Interval each Discovery Indication, in the form of unit+suffix, such as '10ms', '1s' or '1m''. defaults to 0") |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 79 | kafkaBroker := flag.String("k", "", "Kafka broker") |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 80 | interactiveOnuActivation := flag.Bool("ia", false, "Enable interactive activation of ONUs") |
| 81 | mgmtGrpcPort := flag.Int("grpc", 50061, "BBSim API server gRPC port") |
| 82 | mgmtRestPort := flag.Int("rest", 50062, "BBSim API server REST port") |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 83 | o.Mode = DEFAULT |
Mahir Gunyel | 0918334 | 2019-01-29 14:26:50 -0800 | [diff] [blame] | 84 | debg := flag.String("d", "DEBUG", "Debug Level(TRACE DEBUG INFO WARN ERROR)") |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 85 | flag.Parse() |
| 86 | if *modeopt == "aaa" { |
| 87 | o.Mode = AAA |
| 88 | } else if *modeopt == "both" { |
| 89 | o.Mode = BOTH |
| 90 | } |
Mahir Gunyel | 0918334 | 2019-01-29 14:26:50 -0800 | [diff] [blame] | 91 | o.Debuglvl = *debg |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 92 | o.oltid = uint32(*oltid) |
| 93 | o.npon = uint32(*npon) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 94 | // make sure to have at-lease 1 PON port available |
| 95 | if o.npon == 0 { |
| 96 | o.npon = 1 |
| 97 | } |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 98 | o.nonus = uint32(*nonus) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 99 | // make sure to have at-least 1 ONU is available |
| 100 | if o.nonus == 0 { |
| 101 | o.nonus = 1 |
| 102 | } |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 103 | o.aaawait = *aaawait |
| 104 | o.dhcpwait = *dhcpwait |
| 105 | o.dhcpservip = *dhcpservip |
| 106 | o.intvl = *intvl |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 107 | o.interactiveOnuActivation = *interactiveOnuActivation |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 108 | o.KafkaBroker = *kafkaBroker |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 109 | // make sure that 'IP:Port' or ':Port' provided properly. |
| 110 | if !strings.Contains(*addressport, ":") { |
| 111 | log.Fatal("Invalid address given (missing colon)") |
| 112 | } |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 113 | o.address = strings.Split(*addressport, ":")[0] |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 114 | tmp, _ := strconv.Atoi(strings.Split(*addressport, ":")[1]) |
| 115 | o.port = uint32(tmp) |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 116 | o.mgmtGrpcPort = uint32(*mgmtGrpcPort) |
| 117 | o.mgmtRestPort = uint32(*mgmtRestPort) |
| 118 | |
| 119 | if o.interactiveOnuActivation == true { |
| 120 | log.Info("Automatic ONU activation disabled: use BBSim API to activate ONUs") |
| 121 | } |
| 122 | |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 123 | return o |
| 124 | } |
| 125 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 126 | //Mediator stores option, server and testmanager to mediate |
| 127 | type Mediator struct { |
| 128 | opt *Option |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 129 | server *Server |
| 130 | testmanager *TestManager |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 131 | } |
| 132 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 133 | // NewMediator returns a new Mediator object |
| 134 | func NewMediator(o *Option) *Mediator { |
| 135 | m := new(Mediator) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 136 | m.opt = o |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 137 | logger.WithFields(log.Fields{ |
| 138 | "ip": o.address, |
| 139 | "baseport": o.port, |
| 140 | "pon_ports": o.npon, |
| 141 | "onus": o.nonus, |
| 142 | "mode": o.Mode, |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 143 | }).Debug("New Mediator") |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 144 | return m |
| 145 | } |
| 146 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 147 | // Start Mediator |
| 148 | func (m *Mediator) Start() { |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 149 | var wg sync.WaitGroup |
| 150 | opt := m.opt |
Keita NISHIMOTO | 3af86da | 2018-12-12 10:34:43 +0900 | [diff] [blame] | 151 | server := NewCore(opt) |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 152 | server.wg = &sync.WaitGroup{} |
| 153 | server.wg.Add(1) |
| 154 | go server.StartServerActionLoop(&wg) |
| 155 | server.serverActionCh <- "start" |
| 156 | go server.startMgmtServer(&wg) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 157 | |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 158 | tm := NewTestManager(opt) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 159 | m.server = server |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 160 | m.testmanager = tm |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 161 | go func() { |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 162 | m.Mediate() |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 163 | }() |
| 164 | |
| 165 | c := make(chan os.Signal, 1) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 166 | signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 167 | go func() { |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 168 | defer func() { |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 169 | logger.Debug("SIGINT catcher Done") |
| 170 | wg.Done() |
| 171 | }() |
| 172 | for sig := range c { |
| 173 | wg.Add(1) |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 174 | logger.Debug("SIGINT %v", sig) |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 175 | close(c) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 176 | server.Stop() // Non-blocking |
| 177 | err := tm.Stop() // Non-blocking |
| 178 | if err != nil { |
| 179 | logger.Error("Error stopping the TestManager %v", err) |
| 180 | } |
| 181 | err = server.stopMgmtServer() |
| 182 | if err != nil { |
| 183 | logger.Error("Error stopping the Management Server %v", err) |
| 184 | } |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 185 | server.wg.Done() |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 186 | return |
| 187 | } |
| 188 | }() |
| 189 | wg.Wait() |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 190 | server.wg.Wait() |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 191 | } |
| 192 | |
Zdravko Bozakov | 8b9328c | 2019-05-15 05:13:34 +0200 | [diff] [blame] | 193 | // Mediate method is invoked on OLT and ONU state change |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 194 | func (m *Mediator) Mediate() { |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 195 | defer logger.Debug("Mediate Done") |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 196 | for sr := range m.server.stateRepCh { |
| 197 | next := sr.next |
| 198 | current := sr.current |
| 199 | dev := sr.device |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 200 | key := dev.GetDevkey() |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 201 | if reflect.TypeOf(dev) == reflect.TypeOf(&device.Olt{}) { |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 202 | logger.WithFields(log.Fields{ |
| 203 | "device": dev, |
| 204 | }).Debugf("Received OLT Device state change %v Current: %d Next: %d", key, current, next) |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 205 | if err := transitOlt(current, next, m.testmanager, m.opt); err != nil { |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 206 | logger.Error("%v", err) |
| 207 | } |
| 208 | } else if reflect.TypeOf(dev) == reflect.TypeOf(&device.Onu{}) { |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 209 | logger.WithFields(log.Fields{ |
| 210 | "device": dev, |
| 211 | }).Debugf("Received ONU Device state change %v Current: %d Next: %d", key, current, next) |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 212 | if err := transitOnu(key, current, next, m.testmanager, m.opt); err != nil { |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 213 | logger.Error("%v", err) |
| 214 | } |
Keita NISHIMOTO | 9708e04 | 2018-10-27 09:24:44 +0900 | [diff] [blame] | 215 | } |
| 216 | } |
Matteo Scandolo | 88e9189 | 2018-11-06 16:29:19 -0800 | [diff] [blame] | 217 | } |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 218 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 219 | func transitOlt(current device.State, next device.State, tm *TestManager, o *Option) error { |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 220 | logger.Debug("trnsitOlt called current:%d , next:%d", current, next) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 221 | if current == device.OltPreactive && next == device.OltActive { |
| 222 | err := tm.Start() |
| 223 | if err != nil { |
| 224 | logger.Error("Error starting the TestManager %v", err) |
| 225 | } |
Mahir Gunyel | 639c4f7 | 2019-04-26 12:05:32 -0700 | [diff] [blame] | 226 | nniup, _ := makeNniName(o.oltid) |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 227 | err = activateDHCPServer(nniup, o.dhcpservip) |
| 228 | if err != nil { |
| 229 | logger.Error("Error activating DHCP Server %v", err) |
| 230 | } |
| 231 | } else if current == device.OltActive && next == device.OltPreactive { |
| 232 | err := tm.Stop() |
| 233 | if err != nil { |
| 234 | logger.Error("Error stoping the TestManager %v", err) |
| 235 | } |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 236 | } |
| 237 | return nil |
| 238 | } |
| 239 | |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 240 | func transitOnu(key device.Devkey, previous device.State, current device.State, tm *TestManager, o *Option) error { |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 241 | logger.Debug("transitOnu called with key: %v, previous: %s, current: %s", key, device.ONUState[previous], device.ONUState[current]) |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 242 | if o.Mode == AAA || o.Mode == BOTH { |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 243 | if previous == device.OnuActive && current == device.OnuOmciActive { |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 244 | logger.Debug("Starting WPASupplicant for device %v", key) |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 245 | t := tm.CreateTester("AAA", o, key, activateWPASupplicant, o.aaawait) |
| 246 | if err := tm.StartTester(t); err != nil { |
| 247 | logger.Error("Cannot Start AAA Executer error:%v", err) |
| 248 | } |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 249 | } else if previous == device.OnuOmciActive && current == device.OnuInactive { |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 250 | if err := tm.StopTester("AAA", key); err != nil { |
| 251 | logger.Error("Cannot Stop AAA Executer error:%v", err) |
| 252 | } |
Keita NISHIMOTO | 7bce769 | 2019-01-19 09:31:09 +0900 | [diff] [blame] | 253 | } |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 254 | } |
| 255 | |
Zdravko Bozakov | 7401ff2 | 2019-05-28 22:45:12 +0200 | [diff] [blame] | 256 | if o.Mode == BOTH { |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 257 | if previous == device.OnuOmciActive && current == device.OnuAuthenticated { |
Matteo Scandolo | 67add0c | 2019-08-01 16:41:14 -0700 | [diff] [blame] | 258 | logger.Debug("Starting DHCP client for device %v", key) |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 259 | t := tm.CreateTester("DHCP", o, key, activateDHCPClient, o.dhcpwait) |
| 260 | if err := tm.StartTester(t); err != nil { |
| 261 | logger.Error("Cannot Start DHCP Executer error:%v", err) |
| 262 | } |
Zdravko Bozakov | 078a271 | 2019-07-19 23:25:15 +0200 | [diff] [blame^] | 263 | } else if previous == device.OnuAuthenticated && current == device.OnuInactive { |
Keita NISHIMOTO | 2807c54 | 2019-06-04 22:58:32 +0900 | [diff] [blame] | 264 | if err := tm.StopTester("DHCP", key); err != nil { |
| 265 | logger.Error("Cannot Stop DHCP Executer error:%v", err) |
| 266 | } |
Keita NISHIMOTO | dd9f673 | 2019-02-09 09:41:31 +0900 | [diff] [blame] | 267 | } |
Keita NISHIMOTO | 7bce769 | 2019-01-19 09:31:09 +0900 | [diff] [blame] | 268 | } |
Keita NISHIMOTO | 3f08062 | 2019-01-16 10:21:22 +0900 | [diff] [blame] | 269 | return nil |
Mahir Gunyel | 0918334 | 2019-01-29 14:26:50 -0800 | [diff] [blame] | 270 | } |