def setUp(self):
        super(SimpleInstanceTest, self).setUp()
        db_info = DBInstance(
            InstanceTasks.BUILDING, name="TestInstance")
        self.instance = SimpleInstance(
            None, db_info, InstanceServiceStatus(
                ServiceStatuses.BUILDING), ds_version=Mock(), ds=Mock())
        db_info.addresses = {"private": [{"addr": "123.123.123.123"}],
                             "internal": [{"addr": "10.123.123.123"}],
                             "public": [{"addr": "15.123.123.123"}]}
        self.orig_conf = CONF.network_label_regex
        self.orig_ip_regex = CONF.ip_regex
        self.orig_black_list_regex = CONF.black_list_regex
def connectWithSsh(self):
        self._debugLog("Establishing connection to " + self.host)
        self._connection = self.pexpect.spawn(
                'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no %s@%s -p %d' % 
                (self._loginUser.username, self.host, self._port))
        if self._connection is None:
            raise Exception("Unable to connect via SSH perhaps wrong IP!")
        self._secure = True
        self._setupLog()
        self._loginUser.commandLine(self)
        self.modeList = [self._loginUser]