Example #1
0
    def test_unuque_address(self):
        self._create_pxe_ip()

        # address duplicates
        i = utils.new_bm_pxe_ip(address='10.1.1.1',
                                server_address='10.1.1.201')
        self.assertRaises(db_session.DBError, db.bm_pxe_ip_create_direct,
                          self.context, i)

        # server_address duplicates
        i = utils.new_bm_pxe_ip(address='10.1.1.3',
                                server_address='10.1.1.101')
        self.assertRaises(db_session.DBError, db.bm_pxe_ip_create_direct,
                          self.context, i)

        db.bm_pxe_ip_destroy(self.context, self.i1['id'])
        i = utils.new_bm_pxe_ip(address='10.1.1.1',
                                server_address='10.1.1.101')
        ref = db.bm_pxe_ip_create_direct(self.context, i)
        self.assertTrue(ref is not None)
Example #2
0
    def test_unuque_address(self):
        self._create_pxe_ip()

        # address duplicates
        i = utils.new_bm_pxe_ip(address='10.1.1.1',
                                server_address='10.1.1.201')
        self.assertRaises(db_exc.DBError,
                          db.bm_pxe_ip_create_direct,
                          self.context, i)

        # server_address duplicates
        i = utils.new_bm_pxe_ip(address='10.1.1.3',
                                server_address='10.1.1.101')
        self.assertRaises(db_exc.DBError,
                          db.bm_pxe_ip_create_direct,
                          self.context, i)

        db.bm_pxe_ip_destroy(self.context, self.i1['id'])
        i = utils.new_bm_pxe_ip(address='10.1.1.1',
                                server_address='10.1.1.101')
        ref = db.bm_pxe_ip_create_direct(self.context, i)
        self.assertTrue(ref is not None)