mirror of
https://github.com/HuFlungDu/pylibmeshctrl.git
synced 2026-02-20 13:42:11 +00:00
Compare commits
5 Commits
release/1.
...
hotfix/1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77e76aeb7c | ||
|
|
5393321f7b | ||
|
|
79554ebad6 | ||
|
|
1dbcd012ec | ||
|
|
ace6884991 |
@@ -2,6 +2,11 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
Version 1.1.1
|
||||||
|
=============
|
||||||
|
Bugs:
|
||||||
|
* Fixed bug when running device_info when user has access to multiple meshes
|
||||||
|
|
||||||
Version 1.1.0
|
Version 1.1.0
|
||||||
=============
|
=============
|
||||||
Features:
|
Features:
|
||||||
|
|||||||
@@ -1363,10 +1363,10 @@ class Session(object):
|
|||||||
node["meshid"] = meshid
|
node["meshid"] = meshid
|
||||||
if _mesh is not None:
|
if _mesh is not None:
|
||||||
node["mesh"] = _mesh
|
node["mesh"] = _mesh
|
||||||
sysinfo["node"] = node
|
break
|
||||||
sysinfo["nodeid"] = nodeid
|
else:
|
||||||
del sysinfo["result"]
|
continue
|
||||||
del sysinfo["noinfo"]
|
break
|
||||||
if node is None:
|
if node is None:
|
||||||
raise ValueError("Invalid device id")
|
raise ValueError("Invalid device id")
|
||||||
if lastconnect is not None:
|
if lastconnect is not None:
|
||||||
|
|||||||
@@ -200,15 +200,17 @@ async def test_mesh_device(env):
|
|||||||
|
|
||||||
assert r[0].description == "New description", "Description either failed to change, or was changed by a user without permission to do so"
|
assert r[0].description == "New description", "Description either failed to change, or was changed by a user without permission to do so"
|
||||||
|
|
||||||
|
# There once was a bug that occured whenever running run_commands with multiple meshes. We need to add devices to both meshes to be sure that bug is squashed.
|
||||||
with env.create_agent(mesh.short_meshid) as agent,\
|
with env.create_agent(mesh.short_meshid) as agent,\
|
||||||
env.create_agent(mesh.short_meshid) as agent2:
|
env.create_agent(mesh.short_meshid) as agent2,\
|
||||||
|
env.create_agent(mesh2.short_meshid) as agent3:
|
||||||
# Test agent added to device group being propagated correctly
|
# Test agent added to device group being propagated correctly
|
||||||
# Create agent isn't so good at waiting for the agent to show in the sessions. Give it a couple seconds to appear.
|
# Create agent isn't so good at waiting for the agent to show in the sessions. Give it a couple seconds to appear.
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
try:
|
try:
|
||||||
r = await admin_session.list_devices(timeout=10)
|
r = await admin_session.list_devices(timeout=10)
|
||||||
print("\ninfo list_devices: {}\n".format(r))
|
print("\ninfo list_devices: {}\n".format(r))
|
||||||
assert len(r) == 2, "Incorrect number of agents connected"
|
assert len(r) == 3, "Incorrect number of agents connected"
|
||||||
except:
|
except:
|
||||||
if i == 2:
|
if i == 2:
|
||||||
raise
|
raise
|
||||||
@@ -227,6 +229,9 @@ async def test_mesh_device(env):
|
|||||||
r = await admin_session.list_devices(meshid=mesh.meshid, timeout=10)
|
r = await admin_session.list_devices(meshid=mesh.meshid, timeout=10)
|
||||||
print("\ninfo list_devices_meshid: {}\n".format(r))
|
print("\ninfo list_devices_meshid: {}\n".format(r))
|
||||||
|
|
||||||
|
r = await admin_session.device_info(agent.nodeid, timeout=10)
|
||||||
|
print("\ninfo admin_device_info: {}\n".format(r))
|
||||||
|
|
||||||
# Test editing device info propagating correctly
|
# Test editing device info propagating correctly
|
||||||
assert await admin_session.edit_device(agent.nodeid, name="new_name", description="New Description", tags="device", consent=meshctrl.constants.ConsentFlags.all, timeout=10), "Failed to edit device info"
|
assert await admin_session.edit_device(agent.nodeid, name="new_name", description="New Description", tags="device", consent=meshctrl.constants.ConsentFlags.all, timeout=10), "Failed to edit device info"
|
||||||
|
|
||||||
@@ -269,7 +274,7 @@ async def test_mesh_device(env):
|
|||||||
|
|
||||||
# Test getting individual device info
|
# Test getting individual device info
|
||||||
r = await unprivileged_session.device_info(agent.nodeid, timeout=10)
|
r = await unprivileged_session.device_info(agent.nodeid, timeout=10)
|
||||||
print("\ninfo device_info: {}\n".format(r))
|
print("\ninfo unprivileged_device_info: {}\n".format(r))
|
||||||
|
|
||||||
# This device info includes the mesh ID of the device, even though the user doesn't have acces to that mesh. That's odd.
|
# This device info includes the mesh ID of the device, even though the user doesn't have acces to that mesh. That's odd.
|
||||||
# assert r.meshid is None, "Individual device is exposing its meshid"
|
# assert r.meshid is None, "Individual device is exposing its meshid"
|
||||||
|
|||||||
Reference in New Issue
Block a user