summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/heketi/test_create_distributed_replica_heketi_volume.py4
-rw-r--r--tests/functional/heketi/test_heketi_device_operations.py7
-rw-r--r--tests/functional/heketi/test_node_enable_disable.py7
-rw-r--r--tests/functional/heketi/test_volume_multi_req.py10
4 files changed, 19 insertions, 9 deletions
diff --git a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
index 04bce628..8a3beb29 100644
--- a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
+++ b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
@@ -24,8 +24,8 @@ class TestHeketiVolume(BaseClass):
def setUp(self):
super(TestHeketiVolume, self).setUp()
- self.master_node = g.config['ocp_servers']['master'].keys()[0]
- self.gluster_node = g.config["gluster_servers"].keys()[0]
+ self.master_node = list(g.config['ocp_servers']['master'].keys())[0]
+ self.gluster_node = list(g.config["gluster_servers"].keys())[0]
def _get_free_space(self):
"""Get free space in each heketi device"""
diff --git a/tests/functional/heketi/test_heketi_device_operations.py b/tests/functional/heketi/test_heketi_device_operations.py
index bec1d01f..76736ecf 100644
--- a/tests/functional/heketi/test_heketi_device_operations.py
+++ b/tests/functional/heketi/test_heketi_device_operations.py
@@ -1,4 +1,9 @@
-import json
+try:
+ # py2/3
+ import simplejson as json
+except ImportError:
+ # py2
+ import json
import ddt
from glusto.core import Glusto as g
diff --git a/tests/functional/heketi/test_node_enable_disable.py b/tests/functional/heketi/test_node_enable_disable.py
index dcd2f7b4..e1e416fc 100644
--- a/tests/functional/heketi/test_node_enable_disable.py
+++ b/tests/functional/heketi/test_node_enable_disable.py
@@ -1,5 +1,10 @@
"""Test cases to disable and enable node in heketi."""
-import json
+try:
+ # py2/3
+ import simplejson as json
+except ImportError:
+ # py2
+ import json
from glusto.core import Glusto as g
diff --git a/tests/functional/heketi/test_volume_multi_req.py b/tests/functional/heketi/test_volume_multi_req.py
index 3445a8a4..9fcaeb49 100644
--- a/tests/functional/heketi/test_volume_multi_req.py
+++ b/tests/functional/heketi/test_volume_multi_req.py
@@ -219,7 +219,7 @@ class TestVolumeMultiReq(BaseClass):
'wait for volume count to settle timed out')
def _count_vols(self):
- ocp_node = g.config['ocp_servers']['master'].keys()[0]
+ ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
return len(_heketi_vols(ocp_node, self.heketi_server_url))
def test_simple_serial_vol_create(self):
@@ -229,7 +229,7 @@ class TestVolumeMultiReq(BaseClass):
# TODO A nice thing to add to this test would be to also verify
# the gluster volumes also exist.
tname = make_unique_label(extract_method_name(self.id()))
- ocp_node = g.config['ocp_servers']['master'].keys()[0]
+ ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
# deploy a temporary storage class
sc = build_storage_class(
name=tname,
@@ -290,7 +290,7 @@ class TestVolumeMultiReq(BaseClass):
"""
self.addCleanup(self.wait_to_settle)
tname = make_unique_label(extract_method_name(self.id()))
- ocp_node = g.config['ocp_servers']['master'].keys()[0]
+ ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
# deploy a temporary storage class
sc = build_storage_class(
name=tname,
@@ -345,7 +345,7 @@ class TestVolumeMultiReq(BaseClass):
"""
self.addCleanup(self.wait_to_settle)
tname = make_unique_label(extract_method_name(self.id()))
- ocp_node = g.config['ocp_servers']['master'].keys()[0]
+ ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
# deploy a temporary storage class
sc = build_storage_class(
name=tname,
@@ -389,7 +389,7 @@ class TestVolumeMultiReq(BaseClass):
"""
self.addCleanup(self.wait_to_settle)
tname = make_unique_label(extract_method_name(self.id()))
- ocp_node = g.config['ocp_servers']['master'].keys()[0]
+ ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
# deploy a temporary storage class
sc = build_storage_class(
name=tname,