def create_test_portgroup(**kw):
    portgroup = get_test_portgroup(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del portgroup['id']
    dbapi = db_api.get_instance()
    return dbapi.create_portgroup(portgroup)
Create test portgroup entry in DB and return Portgroup DB object.
dataset/ETHPy150Open openstack/ironic/ironic/tests/unit/db/utils.py/create_test_portgroup