vlanassign/test.py
Steve McMaster c46fbf3d72
All checks were successful
continuous-integration/drone/push Build is passing
Initial commit
2022-10-16 16:22:42 +00:00

26 lines
609 B
Python

import pyrad.packet
from pyrad.client import Client
from pyrad.dictionary import Dictionary
srv = Client(
server="127.0.0.1",
secret=b"070c58eb-f79d-4cbb-8482-3aaab089cc88",
dict=Dictionary("dictionary")
)
req = srv.CreateAuthPacket(
code=pyrad.packet.AccessRequest,
User_Name="9273D98A6337",
NAS_Identifier="9273D98A6337"
)
req["User-Password"] = req.PwCrypt("9273D98A6337")
reply = srv.SendPacket(req)
assert reply.code == pyrad.packet.AccessAccept
assert reply["Tunnel-Type"] == [13]
assert reply["Tunnel-Medium-Type"] == [6]
assert reply["Tunnel-Private-Group-ID"] == ["20"]