MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_ssh_activity_builder

Function test_ssh_activity_builder

crates/openshell-ocsf/src/builders/ssh.rs:107–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105
106 #[test]
107 fn test_ssh_activity_builder() {
108 let ctx = test_sandbox_context();
109 let event = SshActivityBuilder::new(&ctx)
110 .activity(ActivityId::Open)
111 .action(ActionId::Allowed)
112 .disposition(DispositionId::Allowed)
113 .severity(SeverityId::Informational)
114 .src_endpoint_addr("10.42.0.1".parse().unwrap(), 48201)
115 .auth_type(AuthTypeId::Other, "NSSH1")
116 .protocol_ver("NSSH1")
117 .message("SSH handshake accepted via NSSH1")
118 .build();
119
120 let json = event.to_json().unwrap();
121 assert_eq!(json["class_uid"], 4007);
122 assert_eq!(json["auth_type"], "NSSH1");
123 assert_eq!(json["auth_type_id"], 99);
124 }
125}

Callers

nothing calls this directly

Calls 7

test_sandbox_contextFunction · 0.85
messageMethod · 0.80
protocol_verMethod · 0.80
auth_typeMethod · 0.80
to_jsonMethod · 0.80
buildMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected