~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/tests/drivers/test_ssh.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
"""Test class for Ironic SSH power driver."""
17
17
 
18
 
import fixtures
 
18
import tempfile
 
19
 
19
20
import mock
20
21
from oslo_concurrency import processutils
21
22
from oslo_config import cfg
 
23
from oslo_utils import uuidutils
22
24
import paramiko
23
25
 
24
26
from ironic.common import boot_devices
73
75
    def test__parse_driver_info_good_file(self):
74
76
        # make sure we get back the expected things
75
77
        d_info = db_utils.get_test_ssh_info('file')
76
 
        tempdir = self.useFixture(fixtures.TempDir())
77
 
        key_path = tempdir.path + '/foo'
 
78
        tempdir = tempfile.mkdtemp()
 
79
        key_path = tempdir + '/foo'
78
80
        open(key_path, 'wt').close()
79
81
        d_info['ssh_key_filename'] = key_path
80
82
        node = obj_utils.get_test_node(
947
949
    def test_management_interface_validate_fail(self):
948
950
        # Missing SSH driver_info information
949
951
        node = obj_utils.create_test_node(self.context,
950
 
                                          uuid=utils.generate_uuid(),
 
952
                                          uuid=uuidutils.generate_uuid(),
951
953
                                          driver='fake_ssh')
952
954
        with task_manager.acquire(self.context, node.uuid) as task:
953
955
            self.assertRaises(exception.MissingParameterValue,