Example #1
0
    def test_enable_ssh(self):
        """
        Test if it enable the SSH daemon
        """
        with patch.object(
                ilo,
                "global_settings",
                return_value={
                    "Global Settings": {
                        "SSH_STATUS": {
                            "VALUE": "Y"
                        }
                    }
                },
        ):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(
                ilo,
                "global_settings",
                return_value={
                    "Global Settings": {
                        "SSH_STATUS": {
                            "VALUE": "N"
                        }
                    }
                },
        ):
            with patch.object(ilo,
                              "__execute_cmd",
                              return_value={"Enable SSH": {}}):
                self.assertDictEqual(ilo.enable_ssh(), {"Enable SSH": {}})
Example #2
0
    def test_enable_ssh(self):
        '''
        Test if it enable the SSH daemon
        '''
        with patch.object(ilo,
                          'global_settings',
                          return_value={
                              'Global Settings': {
                                  'SSH_STATUS': {
                                      'VALUE': 'Y'
                                  }
                              }
                          }):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(ilo,
                          'global_settings',
                          return_value={
                              'Global Settings': {
                                  'SSH_STATUS': {
                                      'VALUE': 'N'
                                  }
                              }
                          }):
            with patch.object(ilo,
                              '__execute_cmd',
                              return_value={'Enable SSH': {}}):
                self.assertDictEqual(ilo.enable_ssh(), {'Enable SSH': {}})
Example #3
0
    def test_enable_ssh(self):
        '''
        Test if it enable the SSH daemon
        '''
        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'SSH_STATUS':
                                                            {'VALUE': 'Y'}}}):
            self.assertTrue(ilo.enable_ssh())

        with patch.object(ilo, 'global_settings',
                          return_value={'Global Settings': {'SSH_STATUS':
                                                            {'VALUE': 'N'}}}):
            with patch.object(ilo, '__execute_cmd',
                              return_value={'Enable SSH': {}}):
                self.assertDictEqual(ilo.enable_ssh(), {'Enable SSH': {}})