def METHOD_NAME(context):
    ifname = context.new_ifname
    ifaddr = context.new_ipaddr
    nsname = context.new_nsname
    context.ndb.sources.add(netns=nsname)
    # create the interface
    (context.ndb.interfaces.create(ifname=ifname, kind='dummy').commit())
    # move it to a netns
    (context.ndb.interfaces[ifname].set('net_ns_fd', nsname).commit())
    # setup the interface only when it is moved
    (
        context.ndb.interfaces.wait(target=nsname, ifname=ifname)
        .set('state', 'up')
        .set('address', '00:11:22:33:44:55')
        .add_ip('%s/24' % ifaddr)
        .commit()
    )
    assert interface_exists(
        nsname, ifname=ifname, state='up', address='00:11:22:33:44:55'
    )