示例#1
0
 def test_handle_rhel_like_arping(self, m_subp):
     """Test handle on RHEL-like distros."""
     items = [{
         'source': '172.16.6.104',
         'destination': '172.17.0.2',
     }]
     ds.gratuitous_arp(items, self._fetch_distro('fedora'))
     self.assertEqual([
         mock.call(
             ['arping', '-c', '2', '-s', '172.16.6.104', '172.17.0.2'])
     ], m_subp.call_args_list)
 def test_handle_rhel_like_arping(self, m_subp):
     """Test handle on RHEL-like distros."""
     items = [{
         "source": "172.16.6.104",
         "destination": "172.17.0.2",
     }]
     ds.gratuitous_arp(items, self._fetch_distro("fedora"))
     self.assertEqual(
         [
             mock.call(
                 ["arping", "-c", "2", "-s", "172.16.6.104", "172.17.0.2"])
         ],
         m_subp.call_args_list,
     )
示例#3
0
 def test_continue_on_arping_error(self, m_subp):
     """Continue when command error"""
     items = [
         {
             'destination': '172.17.0.2',
             'source': '172.16.6.104'
         },
         {
             'destination': '172.17.0.2',
             'source': '172.16.6.104',
         },
     ]
     ds.gratuitous_arp(items, self._fetch_distro('ubuntu'))
     self.assertEqual([
         mock.call(
             ['arping', '-c', '2', '-S', '172.16.6.104', '172.17.0.2']),
         mock.call(
             ['arping', '-c', '2', '-S', '172.16.6.104', '172.17.0.2'])
     ], m_subp.call_args_list)
示例#4
0
 def test_gratuitous_arp_run_standard_arping(self, m_subp):
     """Test handle run arping & parameters."""
     items = [
         {
             'destination': '172.17.0.2',
             'source': '172.16.6.104'
         },
         {
             'destination': '172.17.0.2',
             'source': '172.16.6.104',
         },
     ]
     ds.gratuitous_arp(items, self._fetch_distro('ubuntu'))
     self.assertEqual([
         mock.call(
             ['arping', '-c', '2', '-S', '172.16.6.104', '172.17.0.2']),
         mock.call(
             ['arping', '-c', '2', '-S', '172.16.6.104', '172.17.0.2'])
     ], m_subp.call_args_list)
 def test_continue_on_arping_error(self, m_subp):
     """Continue when command error"""
     items = [
         {
             "destination": "172.17.0.2",
             "source": "172.16.6.104"
         },
         {
             "destination": "172.17.0.2",
             "source": "172.16.6.104",
         },
     ]
     ds.gratuitous_arp(items, self._fetch_distro("ubuntu"))
     self.assertEqual(
         [
             mock.call(
                 ["arping", "-c", "2", "-S", "172.16.6.104", "172.17.0.2"]),
             mock.call(
                 ["arping", "-c", "2", "-S", "172.16.6.104", "172.17.0.2"]),
         ],
         m_subp.call_args_list,
     )
 def test_gratuitous_arp_run_standard_arping(self, m_subp):
     """Test handle run arping & parameters."""
     items = [
         {
             "destination": "172.17.0.2",
             "source": "172.16.6.104"
         },
         {
             "destination": "172.17.0.2",
             "source": "172.16.6.104",
         },
     ]
     ds.gratuitous_arp(items, self._fetch_distro("ubuntu"))
     self.assertEqual(
         [
             mock.call(
                 ["arping", "-c", "2", "-S", "172.16.6.104", "172.17.0.2"]),
             mock.call(
                 ["arping", "-c", "2", "-S", "172.16.6.104", "172.17.0.2"]),
         ],
         m_subp.call_args_list,
     )