Exemplo n.º 1
0
    def test_ip_addrs(self):
        """
        Test for returns a list of IPv4 addresses assigned to the host.
        """
        with patch.object(salt.utils.network, "ip_addrs", return_value=["0.0.0.0"]):
            with patch.object(salt.utils.network, "in_subnet", return_value=True):
                self.assertListEqual(
                    network.ip_addrs("interface", "include_loopback", "cidr"),
                    ["0.0.0.0"],
                )

            self.assertListEqual(
                network.ip_addrs("interface", "include_loopback"), ["0.0.0.0"]
            )
Exemplo n.º 2
0
    def test_ip_addrs(self):
        '''
        Test for returns a list of IPv4 addresses assigned to the host.
        '''
        with patch.object(salt.utils.network, 'ip_addrs',
                          return_value=['0.0.0.0']):
            with patch.object(salt.utils.network, 'in_subnet',
                              return_value=True):
                self.assertListEqual(network.ip_addrs('interface',
                                                      'include_loopback',
                                                      'cidr'), ['0.0.0.0'])

            self.assertListEqual(network.ip_addrs('interface',
                                                  'include_loopback'),
                                 ['0.0.0.0'])
Exemplo n.º 3
0
    def test_ip_addrs(self):
        '''
        Test for returns a list of IPv4 addresses assigned to the host.
        '''
        with patch.object(salt.utils.network, 'ip_addrs',
                          return_value=['0.0.0.0']):
            with patch.object(salt.utils.network, 'in_subnet',
                              return_value=True):
                self.assertListEqual(network.ip_addrs('interface',
                                                      'include_loopback',
                                                      'cidr'), ['0.0.0.0'])

            self.assertListEqual(network.ip_addrs('interface',
                                                  'include_loopback'),
                                 ['0.0.0.0'])
Exemplo n.º 4
0
 def test_ip_addrs(self):
     """
     Test for returns a list of IPv4 addresses assigned to the host.
     """
     with patch.dict(
             network.__utils__,
         {
             "network.ip_addrs": MagicMock(return_value=["0.0.0.0"]),
             "network.in_subnet": MagicMock(return_value=True),
         },
     ):
         self.assertListEqual(
             network.ip_addrs("interface", "include_loopback", "cidr"),
             ["0.0.0.0"])
         self.assertListEqual(
             network.ip_addrs("interface", "include_loopback"), ["0.0.0.0"])