Example #1
0
 def test_reboot(self):
     '''
     Test to reboot the system using the 'reboot' command
     '''
     with patch.dict(system.__salt__,
                     {'cmd.run': MagicMock(return_value='A')}):
         self.assertEqual(system.reboot(), 'A')
Example #2
0
 def test_reboot(self):
     '''
     Test to reboot the system with shutdown -r
     '''
     self.assertEqual(system.reboot(), 'A')
     system.__salt__['cmd.run'].assert_called_with(
         ['shutdown', '-r', 'now'], python_shell=False)
Example #3
0
 def test_reboot_with_delay(self):
     '''
     Test to reboot the system using shutdown -r with a delay
     '''
     self.assertEqual(system.reboot(at_time=5), 'A')
     system.__salt__['cmd.run'].assert_called_with(['shutdown', '-r', '5'],
                                                   python_shell=False)
Example #4
0
 def test_reboot(self):
     '''
     Test to reboot the system using the 'reboot' command
     '''
     with patch.dict(system.__salt__,
                     {'cmd.run': MagicMock(return_value='A')}):
         self.assertEqual(system.reboot(), 'A')
Example #5
0
 def test_reboot_with_delay(self):
     '''
     Test to reboot the system using shutdown -r with a delay
     '''
     self.assertEqual(system.reboot(at_time=5), 'A')
     system.__salt__['cmd.run'].assert_called_with(
         ['shutdown', '-r', '5'], python_shell=False)
Example #6
0
 def test_reboot(self):
     '''
     Test to reboot the system with shutdown -r
     '''
     self.assertEqual(system.reboot(), 'A')
     system.__salt__['cmd.run'].assert_called_with(
         ['shutdown', '-r', 'now'], python_shell=False)
Example #7
0
 def test_reboot_with_delay(self):
     """
     Test to reboot the system using shutdown -r with a delay
     """
     cmd_mock = MagicMock(return_value="A")
     with patch.dict(system.__salt__, {"cmd.run": cmd_mock}):
         self.assertEqual(system.reboot(at_time=5), "A")
     cmd_mock.assert_called_with(["shutdown", "-r", "5"], python_shell=False)
Example #8
0
 def test_reboot(self):
     """
     Test to reboot the system with shutdown -r
     """
     cmd_mock = MagicMock(return_value="A")
     with patch.dict(system.__salt__, {"cmd.run": cmd_mock}):
         self.assertEqual(system.reboot(), "A")
     cmd_mock.assert_called_with(["shutdown", "-r", "now"], python_shell=False)
Example #9
0
 def test_reboot_with_delay(self):
     '''
     Test to reboot the system using shutdown -r with a delay
     '''
     cmd_mock = MagicMock(return_value='A')
     with patch.dict(system.__salt__, {'cmd.run': cmd_mock}):
         self.assertEqual(system.reboot(at_time=5), 'A')
     cmd_mock.assert_called_with(['shutdown', '-r', '5'], python_shell=False)
Example #10
0
 def test_reboot(self):
     '''
     Test to reboot the system with shutdown -r
     '''
     cmd_mock = MagicMock(return_value='A')
     with patch.dict(system.__salt__, {'cmd.run': cmd_mock}):
         self.assertEqual(system.reboot(), 'A')
     cmd_mock.assert_called_with(['shutdown', '-r', 'now'], python_shell=False)