def METHOD_NAME(context):
    ifname = context.new_ifname
    ifaddr1 = context.new_ipaddr
    ifaddr2 = context.new_ipaddr
    ifaddr3 = context.new_ipaddr
    nsname = context.new_nsname
    context.ndb.sources.add(netns=nsname)
    (
        context.ndb.interfaces.create(
            target=nsname, ifname=ifname, kind='dummy'
        )
        .ipaddr.create(address=ifaddr1, prefixlen=24)
        .create(address=ifaddr2, prefixlen=24)
        .create(address=ifaddr3, prefixlen=24)
        .commit()
    )
    with NDB(
        sources=[{'target': 'localhost', 'netns': nsname, 'kind': 'netns'}]
    ) as ndb:
        if_idx = ndb.interfaces[ifname]['index']
        addr1_idx = ndb.addresses['%s/24' % ifaddr1]['index']
        addr2_idx = ndb.addresses['%s/24' % ifaddr2]['index']
        addr3_idx = ndb.addresses['%s/24' % ifaddr3]['index']
    assert if_idx == addr1_idx == addr2_idx == addr3_idx