Skip to content

Commit

Permalink
changes to pbs_cgroups_hook test cases for CRAY
Browse files Browse the repository at this point in the history
  • Loading branch information
anamikau committed Jun 8, 2018
1 parent 149c642 commit fc24927
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions test/tests/functional/pbs_cgroups_hook.py
Expand Up @@ -102,14 +102,15 @@ def setUp(self):

self.vntypenameA = 'no_cgroups'
self.vntypenameB = self.vntypenameA
self.iscray = 0
self.iscray = False
self.noprefix = False
self.tempfile = []
if self.moms:
if len(self.moms) == 1:
self.momA = self.moms.values()[0]
self.momB = self.momA
if self.momA.is_cray():
self.iscray = 1
self.iscray = True
self.hostA = self.momA.shortname
self.hostB = self.hostA
if self.iscray:
Expand All @@ -127,7 +128,7 @@ def setUp(self):
self.momA = self.moms.values()[0]
self.momB = self.moms.values()[1]
if self.momA.is_cray() or self.momB.is_cray():
self.iscray = 1
self.iscray = True
self.hostA = self.momA.shortname
self.hostB = self.momB.shortname
if self.iscray:
Expand All @@ -139,7 +140,7 @@ def setUp(self):
self.vntypenameA = self.get_vntype(self.hostA)
self.vntypenameB = self.get_vntype(self.hostB)
if self.momA.is_cray() or self.momB.is_cray():
self.iscray = 1
self.iscray = True
self.momA.delete_vnode_defs()
self.momB.delete_vnode_defs()
self.server.manager(MGR_CMD_DELETE, NODE, None, "")
Expand Down Expand Up @@ -692,6 +693,8 @@ def get_paths(self):
if entries[2] != 'cgroup':
continue
flags = entries[3].split(',')
if 'noprefix' in flags:
self.noprefix = True
subsys = os.path.basename(entries[1])
paths[subsys] = entries[1]
if 'memory' in flags:
Expand Down Expand Up @@ -1553,7 +1556,7 @@ def test_cgroup_qstat_resources(self):
self.assertNotEqual(mem1, mem2)
self.assertNotEqual(vmem1, vmem2)

@timeout(300)
@timeout(500)
def test_cgroup_reserve_mem(self):
"""
Test to verify that the mom reserve memory for OS
Expand Down Expand Up @@ -1786,7 +1789,7 @@ def test_cgroup_assign_resources_mem_only_vnode(self):
self.server.expect(JOB, a, attrop=PTL_AND, id=jid3, offset=10,
interval=1, max_attempts=30)

@timeout(300)
@timeout(500)
def test_cgroup_cpuset_exclude_cpu(self):
"""
Confirm that exclude_cpus reduces resources_available.ncpus
Expand Down Expand Up @@ -1907,8 +1910,11 @@ def test_cgroup_cpuset_mem_hardwall(self):
self.server.status(JOB, ATTR_o, jid)
o = j.attributes[ATTR_o]
self.tempfile.append(o)
memh_path = 'cpuset.mem_hardwall'
fn = self.get_cgroup_job_dir('cpuset', jid, self.hostA)
fn = os.path.join(fn, 'cpuset.mem_hardwall')
if self.noprefix:
memh_path = 'mem_hardwall'
fn = os.path.join(fn, memh_path)
result = self.du.cat(hostname=self.hostA, filename=fn, sudo=True)
self.assertEqual(result['rc'], 0)
self.assertEqual(result['out'][0], '0')
Expand All @@ -1927,7 +1933,7 @@ def test_cgroup_cpuset_mem_hardwall(self):
o = j.attributes[ATTR_o]
self.tempfile.append(o)
fn = self.get_cgroup_job_dir('cpuset', jid, self.hostA)
fn = os.path.join(fn, 'cpuset.mem_hardwall')
fn = os.path.join(fn, memh_path)
result = self.du.cat(hostname=self.hostA, filename=fn, sudo=True)
self.assertEqual(result['rc'], 0)
self.assertEqual(result['out'][0], '1')
Expand Down Expand Up @@ -1993,8 +1999,11 @@ def test_cgroup_cpuset_memory_spread_page(self):
self.server.status(JOB, ATTR_o, jid)
o = j.attributes[ATTR_o]
self.tempfile.append(o)
spread_path = 'cpuset.memory_spread_page'
fn = self.get_cgroup_job_dir('cpuset', jid, self.hostA)
fn = os.path.join(fn, 'cpuset.memory_spread_page')
if self.noprefix:
spread_path = 'memory_spread_page'
fn = os.path.join(fn, spread_path)
result = self.du.cat(hostname=self.hostA, filename=fn, sudo=True)
self.assertEqual(result['rc'], 0)
self.assertEqual(result['out'][0], '0')
Expand All @@ -2013,7 +2022,7 @@ def test_cgroup_cpuset_memory_spread_page(self):
o = j.attributes[ATTR_o]
self.tempfile.append(o)
fn = self.get_cgroup_job_dir('cpuset', jid, self.hostA)
fn = os.path.join(fn, 'cpuset.memory_spread_page')
fn = os.path.join(fn, spread_path)
result = self.du.cat(hostname=self.hostA, filename=fn, sudo=True)
self.assertEqual(result['rc'], 0)
self.assertEqual(result['out'][0], '1')
Expand Down

0 comments on commit fc24927

Please sign in to comment.