pbs_sister_mom_crash.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # coding: utf-8
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. from tests.functional import *
  37. class TestSisterMom(TestFunctional):
  38. """
  39. This test suite tests the sister mom crash
  40. """
  41. @timeout(240)
  42. def test_sister_mom_crash(self):
  43. """
  44. This test suite verifies that sister mom
  45. doesn't crash
  46. """
  47. # Skip test if number of mom provided is not equal to two
  48. if len(self.moms) != 2:
  49. self.skipTest("test requires atleast two MoMs as input, " +
  50. "use -p moms=<mom1:mom2>")
  51. sister_mom = self.moms.keys()[1]
  52. pbsdsh_path = os.path.join(self.server.pbs_conf['PBS_EXEC'],
  53. "bin", "pbsdsh")
  54. script = "%s dd if=/dev/zero of=/dev/null" % pbsdsh_path
  55. j = Job(TEST_USER)
  56. j.set_attributes({'Resource_List.select': '2',
  57. 'Resource_List.place': 'scatter'})
  58. j.create_script(script)
  59. jid = self.server.submit(j)
  60. self.server.expect(JOB, {'job_state': 'R'}, id=jid)
  61. self.server.log_match(";%s;node down: communication closed"
  62. % (sister_mom),
  63. max_attempts=18, interval=10, existence=False)