fixing tests
This commit is contained in:
parent
94eedfb787
commit
af43aeae91
|
@ -356,6 +356,7 @@ class TestAgentViews(BaseTestCase):
|
|||
url = f"/agents/{self.agent.pk}/meshcentral/"
|
||||
|
||||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
|
||||
# TODO
|
||||
# decode the cookie
|
||||
|
|
|
@ -9,7 +9,6 @@ class TestAuditViews(TacticalTestCase):
|
|||
def setUp(self):
|
||||
self.authenticate()
|
||||
self.setup_coresettings()
|
||||
self.agent_setup()
|
||||
|
||||
def create_audit_records(self):
|
||||
# user jim agent logs
|
||||
|
|
|
@ -46,6 +46,59 @@ class TacticalTestCase(TestCase):
|
|||
r = switch.get(method)
|
||||
self.assertEqual(r.status_code, 401)
|
||||
|
||||
def agent_setup(self):
|
||||
self.agent = Agent.objects.create(
|
||||
operating_system="Windows 10",
|
||||
plat="windows",
|
||||
plat_release="windows-Server2019",
|
||||
hostname="DESKTOP-TEST123",
|
||||
salt_id="aksdjaskdjs",
|
||||
local_ip="10.0.25.188",
|
||||
agent_id="71AHC-AA813-HH1BC-AAHH5-00013|DESKTOP-TEST123",
|
||||
services=[
|
||||
{
|
||||
"pid": 880,
|
||||
"name": "AeLookupSvc",
|
||||
"status": "stopped",
|
||||
"binpath": "C:\\Windows\\system32\\svchost.exe -k netsvcs",
|
||||
"username": "localSystem",
|
||||
"start_type": "manual",
|
||||
"description": "Processes application compatibility cache requests for applications as they are launched",
|
||||
"display_name": "Application Experience",
|
||||
},
|
||||
{
|
||||
"pid": 812,
|
||||
"name": "ALG",
|
||||
"status": "stopped",
|
||||
"binpath": "C:\\Windows\\System32\\alg.exe",
|
||||
"username": "NT AUTHORITY\\LocalService",
|
||||
"start_type": "manual",
|
||||
"description": "Provides support for 3rd party protocol plug-ins for Internet Connection Sharing",
|
||||
"display_name": "Application Layer Gateway Service",
|
||||
},
|
||||
],
|
||||
public_ip="74.13.24.14",
|
||||
total_ram=16,
|
||||
used_ram=33,
|
||||
disks={
|
||||
"C:": {
|
||||
"free": "42.3G",
|
||||
"used": "17.1G",
|
||||
"total": "59.5G",
|
||||
"device": "C:",
|
||||
"fstype": "NTFS",
|
||||
"percent": 28,
|
||||
}
|
||||
},
|
||||
boot_time=8173231.4,
|
||||
logged_in_username="John",
|
||||
client="Google",
|
||||
site="Main Office",
|
||||
monitoring_type="server",
|
||||
description="Test PC",
|
||||
mesh_node_id="abcdefghijklmnopAABBCCDD77443355##!!AI%@#$%#*",
|
||||
last_seen=djangotime.now(),
|
||||
)
|
||||
|
||||
class BaseTestCase(TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue