def test_lb_count_active_by_device(self): lb_fake1 = get_fake_lb('1', 'tenant1') lb_fake2 = get_fake_lb('1', 'tenant2') lb_fake2['status'] = lb_status.ACTIVE lb_ref1 = db_api.loadbalancer_create(self.conf, lb_fake1) lb_ref2 = db_api.loadbalancer_create(self.conf, lb_fake2) result = db_api.lb_count_active_by_device(self.conf, '1') self.assertEqual(result, 1)
def test_lb_count_active_by_device(self): lb_fake1 = get_fake_lb("1", "tenant1") lb_fake2 = get_fake_lb("1", "tenant2") lb_fake2["status"] = lb_status.ACTIVE lb_ref1 = db_api.loadbalancer_create(self.conf, lb_fake1) lb_ref2 = db_api.loadbalancer_create(self.conf, lb_fake2) result = db_api.lb_count_active_by_device(self.conf, "1") self.assertEqual(result, 1)
def lbs_on(conf, lb_ref, dev_ref): return db_api.lb_count_active_by_device(conf, dev_ref['id'])