Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Add test coverage for syncing USB mounting options (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnek authored Jan 11, 2022
1 parent 6f2ae62 commit fbd0de3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/santasyncservice/SNTSyncTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ - (void)testPreflightBasicResponse {
XCTAssertNil(self.syncState.blocklistRegex);
}

- (void)testPreflightBlockUSBMount {
SNTSyncPreflight *sut = [[SNTSyncPreflight alloc] initWithState:self.syncState];

NSData *respData = [self dataFromFixture:@"sync_preflight_toggle_blockusb.json"];
[self stubRequestBody:respData response:nil error:nil validateBlock:nil];

XCTAssertTrue([sut sync]);
XCTAssertEqual(self.syncState.blockUSBMount, true);
NSArray<NSString *> *wantRemountUSBMode = @[ @"rdonly", @"noexec" ];
XCTAssertEqualObjects(self.syncState.remountUSBMode, wantRemountUSBMode);
}

- (void)testPreflightDatabaseCounts {
SNTSyncPreflight *sut = [[SNTSyncPreflight alloc] initWithState:self.syncState];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"allowed_path_regex": null, "client_mode": "LOCKDOWN", "blocked_path_regex": null, "batch_size": 100, "block_usb_mount":true, "remount_usb_mode": ["rdonly", "noexec"]}

0 comments on commit fbd0de3

Please sign in to comment.