Skip to content

Commit 5a1d48d

Browse files
committed
test(plan88): Add UDSError description tests
Tests for UDS error handling: - testUDSErrorDescriptions: Verifies socketPathTooLong, socketCreationFailed, socketBindFailed error descriptions contain relevant details (errno, message, path) These verify error reporting quality for Plan 88 debugging.
1 parent 9734377 commit 5a1d48d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Tests/Container-Compose-Tests/Networking/RelayManagerTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,22 @@ func testUDSWithVirtioFSMountPath() async throws {
908908
XCTFail("Transport should be UDS")
909909
}
910910
}
911+
912+
func testUDSErrorDescriptions() {
913+
// Plan 88: Verify UDS error descriptions are informative
914+
let pathTooLong = UDSError.socketPathTooLong(path: "/tmp/verylongpath.sock", length: 110, limit: 104)
915+
XCTAssertTrue(pathTooLong.description.contains("too long"))
916+
XCTAssertTrue(pathTooLong.description.contains("110"))
917+
XCTAssertTrue(pathTooLong.description.contains("104"))
918+
919+
let creationFailed = UDSError.socketCreationFailed(errno: 13, message: "Permission denied")
920+
XCTAssertTrue(creationFailed.description.contains("creation failed"))
921+
XCTAssertTrue(creationFailed.description.contains("Permission denied"))
922+
923+
let bindFailed = UDSError.socketBindFailed(errno: 98, message: "Address already in use")
924+
XCTAssertTrue(bindFailed.description.contains("bind failed"))
925+
XCTAssertTrue(bindFailed.description.contains("Address already in use"))
926+
}
911927
}
912928

913929
// MARK: - Virtio-FS Detection Tests (Plan 84)

0 commit comments

Comments
 (0)