Files
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

40 lines
1.4 KiB
Swift

import Darwin
import XCTest
@testable import OrcaComputerUseMacOSCore
final class UnixSocketPathSafetyTests: XCTestCase {
func testOnlyUnixSocketModesAreAccepted() {
XCTAssertTrue(UnixSocketPathSafety.isSocketMode(mode_t(S_IFSOCK | 0o600)))
XCTAssertFalse(UnixSocketPathSafety.isSocketMode(mode_t(S_IFREG | 0o600)))
XCTAssertFalse(UnixSocketPathSafety.isSocketMode(mode_t(S_IFDIR | 0o700)))
XCTAssertFalse(UnixSocketPathSafety.isSocketMode(mode_t(S_IFLNK | 0o777)))
}
func testRejectsOnlyNonSocketPathsAfterAddressInUseBindFailure() {
XCTAssertTrue(
UnixSocketPathSafety.shouldRejectExistingPathAfterBindFailure(
bindErrno: EADDRINUSE,
existingMode: mode_t(S_IFREG | 0o600)
)
)
XCTAssertFalse(
UnixSocketPathSafety.shouldRejectExistingPathAfterBindFailure(
bindErrno: EADDRINUSE,
existingMode: mode_t(S_IFSOCK | 0o600)
)
)
XCTAssertFalse(
UnixSocketPathSafety.shouldRejectExistingPathAfterBindFailure(
bindErrno: EACCES,
existingMode: mode_t(S_IFREG | 0o600)
)
)
XCTAssertFalse(
UnixSocketPathSafety.shouldRejectExistingPathAfterBindFailure(
bindErrno: EADDRINUSE,
existingMode: nil
)
)
}
}