Daniele Rossi | 856b06d | 2019-10-04 16:34:35 +0200 | [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 | // This file implements an exit handler that tries to shut down all the |
| 18 | // running servers before finally exiting. There are 2 triggers to this |
| 19 | // clean exit thread: signals and an exit channel. |
| 20 | |
| 21 | package afrouter |
| 22 | |
| 23 | import ( |
| 24 | "github.com/opencord/voltha-go/common/log" |
| 25 | "github.com/stretchr/testify/assert" |
| 26 | "testing" |
| 27 | ) |
| 28 | |
| 29 | func init() { |
| 30 | log.SetDefaultLogger(log.JSON, log.DebugLevel, nil) |
| 31 | log.AddPackage(log.JSON, log.WarnLevel, nil) |
| 32 | } |
| 33 | |
| 34 | // Test for function signalHandler and cleanExit |
| 35 | func TestSignalsInitExitHandler(t *testing.T) { |
| 36 | |
| 37 | assert.Nil(t, InitExitHandler()) |
| 38 | |
| 39 | } |