Skip to content

Commit b0b9487

Browse files
author
Farhan Nomani
committed
Fix for broken unit tests
1 parent e206a7a commit b0b9487

File tree

3 files changed

+6
-42
lines changed

3 files changed

+6
-42
lines changed

Diff for: test/HPE3ParClient_base.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,8 @@ def setUp(self, withSSH=False, withFilePersona=False):
125125
except Exception:
126126
pass
127127

128-
time.sleep(5)
129-
if self.withFilePersona:
130-
pass
131-
#self.cl = file_client.HPE3ParFilePersonaClient(self.flask_url)
132-
else:
133-
self.cl = client.HPE3ParClient(self.flask_url)
128+
time.sleep(1)
129+
self.cl = client.HPE3ParClient(self.flask_url)
134130

135131
if self.withSSH:
136132

@@ -209,10 +205,8 @@ def setUp(self, withSSH=False, withFilePersona=False):
209205

210206
if not self.port:
211207
ports = self.cl.getPorts()
212-
print "hello"
213-
print vars(self.cl)
214-
for port in ports:
215-
print port.mode
208+
for port in ports:
209+
#print port.mode
216210
ports = [port for port in ports if port.linkState == 4 and ( port.device is not None or not port.device) and port.mode == 2]
217211
self.port = ports[0].port_pos
218212

Diff for: test/HPE3ParMockServer_flask.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1697,9 +1697,7 @@ def get_overall_capacity():
16971697
@app.route('/api', methods=['GET'])
16981698
def get_version():
16991699
debugRequest(flask.request)
1700-
version = {'major': 1,
1701-
'minor': 3,
1702-
'build': 30201256}
1700+
version = {"major": 1, "minor": 6, "revision": 3, "build": 30301418}
17031701
resp = flask.make_response(json.dumps(version), 200)
17041702
return resp
17051703

Diff for: test/config.ini

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1 @@
1-
[TEST]
2-
flask_url=http://0.0.0.0:5001/api/v1
3-
#flask_url=http://localhost:5001/api/v1
4-
user=USERNAME
5-
pass=PASSWORD
6-
unit=true
7-
debug=false
8-
3par_url=http://10.10.##.##:8008/api/v1
9-
cpg_ldlayout_ha=3
10-
disk_type=3
11-
domain=UNIT_TEST_DOMAIN
12-
missing_key_policy=AutoAddPolicy
13-
# skip_file_persona: Set to true when using an array without File Persona
14-
skip_file_persona=true
15-
# To speed up File Persona tests, specify an existing FPG to use.
16-
# fpg=unit_test_fpg
17-
# To run remote copy tests against live arrays, set this to true
18-
run_remote_copy=false
19-
20-
# If run_remote_copy is set to true, remote copy tests will be run. For this
21-
# to work as intended, a secondary array must be specified in the below
22-
# section. The URL, username, password, and the 3PAR target name are required
23-
# entries. The domain specified in the TEST config group must also be present
24-
# on the secondary array.
25-
[TEST_REMOTE_COPY]
26-
3par_url=http://10.10.##.##:8008/api/v1
27-
user=USERNAME
28-
pass=PASSWORD
29-
target_name=TARGET
1+
../config.ini

0 commit comments

Comments
 (0)