import sys, unittest

from singlesystemtest import SingleSystemTest

class TestBmcInfo(SingleSystemTest):
    def test_bmc_info(self):
        """BMC info provides expected results"""
        info = self.bmc.info()
        check_items = self.get_checks()['BMCInfo']

        for item,expected in check_items.iteritems():
            self.assertEqual(expected, getattr(info, item))

tests = [TestBmcInfo]

if __name__ == '__main__':
    for test in tests:
        test.system = sys.argv[1]
        suite = unittest.TestLoader().loadTestsFromTestCase(test)
        unittest.TextTestRunner(verbosity=5).run(suite)

import sys, unittest

from singlesystemtest import SingleSystemTest

class TestBmcInfo(SingleSystemTest):
    def test_bmc_info(self):
        """BMC info provides expected results"""
        info = self.bmc.info()
        check_items = self.get_checks()['BMCInfo']

        for item,expected in check_items.iteritems():
            self.assertEqual(expected, getattr(info, item))

    def test_bmc_info_eleven_times(self):
        """BMC info provides expected results 11 times in a row"""
        for i in range(0, 11):
            info = self.bmc.info()
            check_items = self.get_checks()['BMCInfo']

            for item,expected in check_items.iteritems():
                self.assertEqual(expected, getattr(info, item))

tests = [TestBmcInfo]

if __name__ == '__main__':
    for test in tests:
        test.system = sys.argv[1]
        suite = unittest.TestLoader().loadTestsFromTestCase(test)
        unittest.TextTestRunner(verbosity=5).run(suite)

Add a test for bmc info working eleven times in a row
Add a test for bmc info working eleven times in a row

This is specifically to check for SW-732, where results stop after 10
bmc info requests.

  import sys, unittest
  
  from singlesystemtest import SingleSystemTest
  
  class TestBmcInfo(SingleSystemTest):
      def test_bmc_info(self):
          """BMC info provides expected results"""
          info = self.bmc.info()
          check_items = self.get_checks()['BMCInfo']
  
          for item,expected in check_items.iteritems():
              self.assertEqual(expected, getattr(info, item))
  
+     def test_bmc_info_eleven_times(self):
+         """BMC info provides expected results 11 times in a row"""
+         for i in range(0, 11):
+             info = self.bmc.info()
+             check_items = self.get_checks()['BMCInfo']
+ 
+             for item,expected in check_items.iteritems():
+                 self.assertEqual(expected, getattr(info, item))
+ 
  tests = [TestBmcInfo]
  
  if __name__ == '__main__':
      for test in tests:
          test.system = sys.argv[1]
          suite = unittest.TestLoader().loadTestsFromTestCase(test)
          unittest.TextTestRunner(verbosity=5).run(suite)
  
Add a test for bmc info working eleven times in a row
## Code Before:
import sys, unittest

from singlesystemtest import SingleSystemTest

class TestBmcInfo(SingleSystemTest):
    def test_bmc_info(self):
        """BMC info provides expected results"""
        info = self.bmc.info()
        check_items = self.get_checks()['BMCInfo']

        for item,expected in check_items.iteritems():
            self.assertEqual(expected, getattr(info, item))

tests = [TestBmcInfo]

if __name__ == '__main__':
    for test in tests:
        test.system = sys.argv[1]
        suite = unittest.TestLoader().loadTestsFromTestCase(test)
        unittest.TextTestRunner(verbosity=5).run(suite)

## Instruction:
Add a test for bmc info working eleven times in a row
## Code After:
import sys, unittest

from singlesystemtest import SingleSystemTest

class TestBmcInfo(SingleSystemTest):
    def test_bmc_info(self):
        """BMC info provides expected results"""
        info = self.bmc.info()
        check_items = self.get_checks()['BMCInfo']

        for item,expected in check_items.iteritems():
            self.assertEqual(expected, getattr(info, item))

    def test_bmc_info_eleven_times(self):
        """BMC info provides expected results 11 times in a row"""
        for i in range(0, 11):
            info = self.bmc.info()
            check_items = self.get_checks()['BMCInfo']

            for item,expected in check_items.iteritems():
                self.assertEqual(expected, getattr(info, item))

tests = [TestBmcInfo]

if __name__ == '__main__':
    for test in tests:
        test.system = sys.argv[1]
        suite = unittest.TestLoader().loadTestsFromTestCase(test)
        unittest.TextTestRunner(verbosity=5).run(suite)
