[RICPLT-2165] Add rnibDataService to support retries
[ric-plt/e2mgr.git] / Automation / Tests / Scripts / loadscripts.py
1 ##############################################################################
2 #
3 #   Copyright (c) 2019 AT&T Intellectual Property.
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 ##############################################################################
18
19
20 import redis
21 import config
22
23
24 def verify_value():
25
26     c = config.redis_ip_address
27
28     p = config.redis_ip_port
29
30     r = redis.Redis(host=c, port=p, db=0)
31
32     value = "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00"
33
34     if r.get("{e2Manager},LOAD:test1") != value:
35         return True
36     else:
37         return False
38
39
40 def add():
41
42     c = config.redis_ip_address
43
44     p = config.redis_ip_port
45
46     r = redis.Redis(host=c, port=p, db=0)
47
48     r.set("{e2Manager},LOAD:test1", "\b\x98\xf7\xdd\xa3\xc7\xb4\x83\xde\x15\x12\x11\n\x0f02f829:0007ab00")
49
50     if r.exists("{e2Manager},LOAD:test1"):
51         return True
52     else:
53         return False
54
55
56 def verify():
57
58     c = config.redis_ip_address
59
60     p = config.redis_ip_port
61
62     r = redis.Redis(host=c, port=p, db=0)
63
64     if r.exists("{e2Manager},LOAD:test1"):
65         return True
66     else:
67         return False