Update test "test_fairshare_formula5" of pbs_fairshare.py

Description

Issue:
test_formula5 of pbs_fairshare.py failed on 18.2.0 build

Error:
2017-11-15 05:04:01,309 INFO scheduler pbspro-master: config {'log_filter': 2048, 'fair_share': 'True All'}
2017-11-15 05:04:01,311 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/cp -p /var/spool/pbs/sched_priv/sched_config /var/spool/pbs/sched_priv/sched_config.bak
2017-11-15 05:04:01,325 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/cp -p /tmp/PtlPbscT9T6O /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,338 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chmod 0644 /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,352 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chown root /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,365 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chgrp root /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,379 INFO scheduler pbspro-master: sent signal -HUP
2017-11-15 05:04:01,379 INFOCLI2 pbspro-master: sudo -H kill -HUP 564
2017-11-15 05:04:01,397 INFO scheduler pbspro-master log match: searching for "Error reading line" - No match
2017-11-15 05:04:01,910 INFO scheduler pbspro-master log match: searching for "Error reading line"... OK
2017-11-15 05:04:01,911 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/cp -p /var/spool/pbs/sched_priv/sched_config /var/spool/pbs/sched_priv/sched_config.bak
2017-11-15 05:04:01,927 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/cp -p /tmp/PtlPbsJGeeaT /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,940 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chmod 0644 /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,953 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chown root /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,967 INFOCLI2 pbspro-master: sudo -H /opt/tools/wrappers/chgrp root /var/spool/pbs/sched_priv/sched_config
2017-11-15 05:04:01,981 INFO scheduler pbspro-master: sent signal -HUP
2017-11-15 05:04:01,981 INFOCLI2 pbspro-master: sudo -H kill -HUP 564
2017-11-15 05:04:01,998 INFO scheduler pbspro-master log match: searching for "Error reading line"... OK
2017-11-15 05:04:02,003 INFO ERROR

2017-11-15 05:04:02,004 INFO ===============================
2017-11-15 05:04:02,004 INFO Entered TestFairshare tearDown
2017-11-15 05:04:02,004 INFO ===============================
2017-11-15 05:04:02,004 INFO ================================
2017-11-15 05:04:02,005 INFO Completed TestFairshare tearDown
2017-11-15 05:04:02,005 INFO ================================
2017-11-15 05:04:02,008 INFO
2017-11-15 05:04:02,008 INFO ======================================================================
2017-11-15 05:04:02,009 INFO ERROR: test_fairshare_formula5 (tests.functional.pbs_fairshare.TestFairshare)

2017-11-15 05:04:02,009 INFO __m_oo_m__
2017-11-15 05:04:02,009 INFO Traceback (most recent call last):
File "/home/pbsroot/TEST/tmp/tests/functional/pbs_fairshare.py", line 227, in test_fairshare_formula5
self.scheduler.set_sched_config(a)
File "/home/pbsroot/TEST/tmp/18.2.0/lib/python2.7/site-packages/ptl/lib/pbs_testlib.py", line 10842, in set_sched_config
self.apply_config(validate=validate)
File "/home/pbsroot/TEST/tmp/18.2.0/lib/python2.7/site-packages/ptl/lib/pbs_testlib.py", line 10819, in apply_config
msg=_msg)
PbsSchedConfigError: rc=1, rv=False, msg=Error in validating sched_config changes

Code-snippet:
a = {'log_filter': 2048, 'fair_share': "True All"}
self.scheduler.set_sched_config(a)

*Analysis:

  • The test is trying to update values of "log_filter, fairshare" entries in sched_config file.

  • The test is failing while updating the fairshare entry to "True All" in the sched_config file. This is because the valid values for fairshare attribute are
    fairshare: True/true/TRUE/False/false/FALSE ALL/all

  • In the test the value given for fairshare is True

    All

    which is not the valid value.

Solution Description:

  • Update the value to be either ALL/all in the test.

  • Also check for the following message in sched_logs after setting the fairshare value in order to validate the test
    ";fairshare usage;Creating usage database for fairshare"

Acceptance Criteria

None

Assignee

anamika upadhyay

Reporter

zulekha mahalty

Severity

None

OS

None

Start Date

None

Pull Request URL

Story Points

1

Components

Fix versions

Affects versions

Priority

High
Configure