예제 #1
0
 def test_install_agent(self):
     """
     Tests if it downloads Server Density installation agent,
     and installs sd-agent with agent_key.
     """
     mock = MagicMock(return_value=True)
     with patch.dict(serverdensity_device.__pillar__, {"serverdensity": {"account_url": "salt"}}):
         with patch.dict(serverdensity_device.__salt__, {"cmd.run": mock}):
             with patch.dict(serverdensity_device.__opts__, {"cachedir": "/"}):
                 self.assertTrue(serverdensity_device.install_agent("51f7e"))
예제 #2
0
 def test_install_agent(self):
     '''
     Tests if it downloads Server Density installation agent,
     and installs sd-agent with agent_key.
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(serverdensity_device.__pillar__,
                     {'serverdensity': {'account_url': 'salt'}}):
         with patch.dict(serverdensity_device.__salt__, {'cmd.run': mock}):
             with patch.dict(serverdensity_device.__opts__,
                             {'cachedir': '/'}):
                 self.assertTrue(serverdensity_device.install_agent('51f7e'))
예제 #3
0
 def test_install_agent(self):
     '''
     Tests if it downloads Server Density installation agent,
     and installs sd-agent with agent_key.
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(serverdensity_device.__pillar__,
                     {'serverdensity': {'account_url': 'salt'}}):
         with patch.dict(serverdensity_device.__salt__, {'cmd.run': mock}):
             with patch.dict(serverdensity_device.__opts__,
                             {'cachedir': '/'}):
                 self.assertTrue(serverdensity_device.install_agent('51f7e'))
예제 #4
0
 def test_install_agent(self):
     """
     Tests if it downloads Server Density installation agent,
     and installs sd-agent with agent_key.
     """
     mock = MagicMock(return_value=True)
     with patch.dict(serverdensity_device.__pillar__,
                     {"serverdensity": {
                         "account_url": "salt"
                     }}):
         with patch.dict(serverdensity_device.__salt__, {"cmd.run": mock}):
             with patch.dict(serverdensity_device.__opts__,
                             {"cachedir": "/"}):
                 self.assertTrue(
                     serverdensity_device.install_agent("51f7e"))