mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-03-13 22:22:13 +00:00
17 lines
331 B
Python
17 lines
331 B
Python
from pyroute2 import IPRoute
|
|
|
|
|
|
def test_ipr():
|
|
with IPRoute() as ipr:
|
|
lo = ipr.link('get', ifname='lo')[0]
|
|
a = [
|
|
dict(a['attrs'])['IFA_ADDRESS']
|
|
for a in ipr.get_addr(index=lo['index'])
|
|
]
|
|
print(repr(a))
|
|
assert '127.0.0.1' in a
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_ipr()
|