blob: 2729de09af2481451ae440595f127f188dcd7ca4 [file] [log] [blame]
khenaidoobf6e7bb2018-08-14 22:27:29 -04001/*
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 */
Stephane Barbarie4a2564d2018-07-26 11:02:58 -040016package model
17
Stephane Barbarie4a2564d2018-07-26 11:02:58 -040018var (
Stephane Barbarie88fbe7f2018-09-25 12:25:23 -040019 backend *Backend
20 rootPrefix = "service/voltha/data/core/0001"
Stephane Barbarie4a2564d2018-07-26 11:02:58 -040021
Stephane Barbarie88fbe7f2018-09-25 12:25:23 -040022 //basePrefix = "service/voltha/service/vcores/data/devices"
23 deviceId = "00016f13befaedcc"
24 //rootPrefix = basePrefix + "/" + deviceId
Stephane Barbarie4a2564d2018-07-26 11:02:58 -040025 deviceProxy = "/devices/" + deviceId
26)
27
Stephane Barbarie933b09b2019-01-09 11:12:09 -050028//func Test_NewRoot(t *testing.T) {
29// backend = NewBackend(ETCD_KV, etcd_host, etcd_port, timeout, rootPrefix)
30//
31// var msgClass *voltha.Voltha
32// //var msgClass *voltha.DeviceInstance
33// root := NewRoot(msgClass, backend)
34//
35// start := time.Now()
36//
37// //r := root.Load(msgClass)
38// afterLoad := time.Now()
39// log.Infof(">>>>>>>>>>>>> Time to Load : %f\n", afterLoad.Sub(start).Seconds())
40//
41// d := r.node.Get(deviceProxy, "", 0, false, "")
42// afterGet := time.Now()
43// log.Infof(">>>>>>>>>>>>> Time to Load and get: %f\n", afterGet.Sub(start).Seconds())
44//
45// jr, _ := json.Marshal(r)
46// log.Infof("Content of ROOT --> \n%s\n", jr)
47//
48// jd, _ := json.Marshal(d)
49// log.Infof("Content of GET --> \n%s\n", jd)
50//
51//}