From 7a2c5584c837497adcb6490188b0da4fff1c3336 Mon Sep 17 00:00:00 2001 From: c7bercat Date: Thu, 25 Aug 2022 15:41:15 -0500 Subject: [PATCH 1/8] add the first test, not sure if it actually works yet heh --- aftermath.xcodeproj/project.pbxproj | 156 +++++++++++++++++- .../xcshareddata/xcschemes/aftermath.xcscheme | 10 ++ aftermath/Aftermath.swift | 5 +- aftermathTests/aftermathTests.swift | 35 ++++ tests/aftermath/AftermathTests.swift | 94 +++++++++++ tests/mocks/MockFileManager.swift | 21 +++ 6 files changed, 315 insertions(+), 6 deletions(-) create mode 100644 aftermathTests/aftermathTests.swift create mode 100644 tests/aftermath/AftermathTests.swift create mode 100644 tests/mocks/MockFileManager.swift diff --git a/aftermath.xcodeproj/project.pbxproj b/aftermath.xcodeproj/project.pbxproj index 5723390..c976f03 100644 --- a/aftermath.xcodeproj/project.pbxproj +++ b/aftermath.xcodeproj/project.pbxproj @@ -45,6 +45,11 @@ A0E1E3F6275ED2E4008D0DC6 /* NetworkModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E1E3F5275ED2E4008D0DC6 /* NetworkModule.swift */; }; A0E1E3F8275ED35D008D0DC6 /* NetworkConnections.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E1E3F7275ED35D008D0DC6 /* NetworkConnections.swift */; }; A0E22EF2285CD60A003A411A /* CommonDirectories.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E22EF1285CD60A003A411A /* CommonDirectories.swift */; }; + A190FFD028B8084F00B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; + A190FFD328B8094600B9EF9A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A190FFD228B8094600B9EF9A /* XCTest.framework */; }; + A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; + A190FFDE28B8151300B9EF9A /* aftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFDD28B8151300B9EF9A /* aftermathTests.swift */; }; + A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; A3046F8E27627DAC0069AA21 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8D27627DAC0069AA21 /* Module.swift */; }; A3046F902763AE5E0069AA21 /* CaseFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */; }; A3745358275730870074B65C /* LaunchItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3745357275730870074B65C /* LaunchItems.swift */; }; @@ -107,6 +112,11 @@ A0E1E3F7275ED35D008D0DC6 /* NetworkConnections.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkConnections.swift; sourceTree = ""; }; A0E22EF1285CD60A003A411A /* CommonDirectories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonDirectories.swift; sourceTree = ""; }; A0E46B8A288F55A600975EC8 /* aftermath.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = aftermath.entitlements; sourceTree = ""; }; + A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AftermathTests.swift; sourceTree = ""; }; + A190FFD228B8094600B9EF9A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + A190FFD528B80C3900B9EF9A /* MockFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFileManager.swift; sourceTree = ""; }; + A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = aftermathTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A190FFDD28B8151300B9EF9A /* aftermathTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = aftermathTests.swift; sourceTree = ""; }; A3046F8D27627DAC0069AA21 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaseFiles.swift; sourceTree = ""; }; A3745357275730870074B65C /* LaunchItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchItems.swift; sourceTree = ""; }; @@ -118,10 +128,18 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + A190FFD828B8151300B9EF9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A3CD4E4F274434EE00869ECB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A190FFD328B8094600B9EF9A /* XCTest.framework in Frameworks */, A0C930CF289852E80011FB87 /* ZIPFoundation in Frameworks */, A0C930D728A543F80011FB87 /* SwiftCSV in Frameworks */, ); @@ -264,6 +282,47 @@ path = filesystem; sourceTree = ""; }; + A190FFCD28B8080100B9EF9A /* tests */ = { + isa = PBXGroup; + children = ( + A190FFD428B80C2D00B9EF9A /* mocks */, + A190FFCE28B8083600B9EF9A /* aftermath */, + ); + path = tests; + sourceTree = ""; + }; + A190FFCE28B8083600B9EF9A /* aftermath */ = { + isa = PBXGroup; + children = ( + A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */, + ); + path = aftermath; + sourceTree = ""; + }; + A190FFD128B8094600B9EF9A /* Frameworks */ = { + isa = PBXGroup; + children = ( + A190FFD228B8094600B9EF9A /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + A190FFD428B80C2D00B9EF9A /* mocks */ = { + isa = PBXGroup; + children = ( + A190FFD528B80C3900B9EF9A /* MockFileManager.swift */, + ); + path = mocks; + sourceTree = ""; + }; + A190FFDC28B8151300B9EF9A /* aftermathTests */ = { + isa = PBXGroup; + children = ( + A190FFDD28B8151300B9EF9A /* aftermathTests.swift */, + ); + path = aftermathTests; + sourceTree = ""; + }; A374535B2757C1110074B65C /* extensions */ = { isa = PBXGroup; children = ( @@ -275,6 +334,7 @@ A3CD4E49274434EE00869ECB = { isa = PBXGroup; children = ( + A190FFCD28B8080100B9EF9A /* tests */, A029AB1128769F6C00649701 /* libs */, A3CD4E54274434EE00869ECB /* aftermath */, A08342D4284A8211005E437A /* analysis */, @@ -288,7 +348,9 @@ 70A44401275707800035F40E /* systemRecon */, 8ABB9E2927568E9000C0ADD7 /* unifiedlogs */, A3A3A3CD274754B400F8F557 /* Readme.md */, + A190FFDC28B8151300B9EF9A /* aftermathTests */, A3CD4E53274434EE00869ECB /* Products */, + A190FFD128B8094600B9EF9A /* Frameworks */, ); sourceTree = ""; }; @@ -296,6 +358,7 @@ isa = PBXGroup; children = ( A3CD4E52274434EE00869ECB /* aftermath */, + A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */, ); name = Products; sourceTree = ""; @@ -316,6 +379,23 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + A190FFDA28B8151300B9EF9A /* aftermathTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "aftermathTests" */; + buildPhases = ( + A190FFD728B8151300B9EF9A /* Sources */, + A190FFD828B8151300B9EF9A /* Frameworks */, + A190FFD928B8151300B9EF9A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = aftermathTests; + productName = aftermathTests; + productReference = A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; A3CD4E51274434EE00869ECB /* aftermath */ = { isa = PBXNativeTarget; buildConfigurationList = A3CD4E59274434EE00869ECB /* Build configuration list for PBXNativeTarget "aftermath" */; @@ -344,9 +424,12 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1310; + LastSwiftUpdateCheck = 1340; LastUpgradeCheck = 1320; TargetAttributes = { + A190FFDA28B8151300B9EF9A = { + CreatedOnToolsVersion = 13.4; + }; A3CD4E51274434EE00869ECB = { CreatedOnToolsVersion = 13.1; LastSwiftMigration = 1340; @@ -371,11 +454,31 @@ projectRoot = ""; targets = ( A3CD4E51274434EE00869ECB /* aftermath */, + A190FFDA28B8151300B9EF9A /* aftermathTests */, ); }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + A190FFD928B8151300B9EF9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ + A190FFD728B8151300B9EF9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */, + A190FFDE28B8151300B9EF9A /* aftermathTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A3CD4E4E274434EE00869ECB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -401,6 +504,7 @@ A029AB2B2877F52D00649701 /* launchdXPC.m in Sources */, A0E1E3EF275EC810008D0DC6 /* Safari.swift in Sources */, A006B5A12882FBA70091FAA1 /* DatabaseParser.swift in Sources */, + A190FFD028B8084F00B9EF9A /* AftermathTests.swift in Sources */, 70A44405275A76990035F40E /* LSQuarantine.swift in Sources */, A374535D2757C1300074B65C /* FileManager.swift in Sources */, A09B239C2848F6050062D592 /* Periodic.swift in Sources */, @@ -416,6 +520,7 @@ A0E1E3F6275ED2E4008D0DC6 /* NetworkModule.swift in Sources */, A076742C27555FC100ED7066 /* PersistenceModule.swift in Sources */, A0D6D54727FE147D002BB3C8 /* Overrides.swift in Sources */, + A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */, A0D6D54927FE52C1002BB3C8 /* SystemExtensions.swift in Sources */, A08342D6284A8247005E437A /* AnalysisModule.swift in Sources */, A029AB192876A29600649701 /* Pids.swift in Sources */, @@ -428,6 +533,38 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ + A190FFE028B8151300B9EF9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 483DWKW443; + GENERATE_INFOPLIST_FILE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.jamf.aftermath.aftermathTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + A190FFE128B8151300B9EF9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 483DWKW443; + GENERATE_INFOPLIST_FILE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.jamf.aftermath.aftermathTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; A3CD4E57274434EE00869ECB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -551,9 +688,9 @@ ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = aftermath/aftermath.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = 6PV5YF2UES; + DEVELOPMENT_TEAM = 483DWKW443; ENABLE_HARDENED_RUNTIME = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -577,9 +714,9 @@ ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = aftermath/aftermathRelease.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = 6PV5YF2UES; + DEVELOPMENT_TEAM = 483DWKW443; ENABLE_HARDENED_RUNTIME = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -600,6 +737,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "aftermathTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A190FFE028B8151300B9EF9A /* Debug */, + A190FFE128B8151300B9EF9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A3CD4E4D274434EE00869ECB /* Build configuration list for PBXProject "aftermath" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme index 062be28..2e8ee2c 100644 --- a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme +++ b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme @@ -28,6 +28,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + String { let task = Process() @@ -30,7 +33,7 @@ class Aftermath { var data = Data() var plistDict = [String:Any]() - if FileManager.default.fileExists(atPath: atUrl.relativePath) { + if fm.fileExists(atPath: atUrl.relativePath) { do { data = try Data(contentsOf: atUrl) plistDict = try PropertyListSerialization.propertyList(from: data, format: nil) as! [String:Any] diff --git a/aftermathTests/aftermathTests.swift b/aftermathTests/aftermathTests.swift new file mode 100644 index 0000000..53b4cc4 --- /dev/null +++ b/aftermathTests/aftermathTests.swift @@ -0,0 +1,35 @@ +// +// aftermathTests.swift +// aftermathTests +// +// Created by Maggie Zirnhelt on 8/25/22. +// + +import XCTest + +class aftermathTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/tests/aftermath/AftermathTests.swift b/tests/aftermath/AftermathTests.swift new file mode 100644 index 0000000..1e313e2 --- /dev/null +++ b/tests/aftermath/AftermathTests.swift @@ -0,0 +1,94 @@ +// +// AftermathTests.swift +// aftermath +// +// Created by Maggie Zirnhelt on 8/25/22. +// + +import XCTest + +class AftermathTests: XCTestCase { + + override func setUpWithError() throws { + + } + + override func tearDownWithError() throws { + + } + + // MARK: getPlistAsDict + + func testGetPlistAsDict() throws { + // Given + let url = try XCTUnwrap(URL(string: UUID().uuidString)) + let plist = + """ + gui/501/com.jamf.protect.agent = { + active count = 0 + path = /Library/LaunchAgents/com.jamf.protect.agent.plist + state = spawn scheduled + + program = /Applications/JamfProtect.app/Contents/Helpers/JamfProtectAgent.app/Contents/MacOS/JamfProtectAgent + inherited environment = { + SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.oi4pZOD54K/Listeners + } + + default environment = { + PATH => /usr/bin:/bin:/usr/sbin:/sbin + } + + environment = { + XPC_SERVICE_NAME => com.jamf.protect.agent + } + + domain = gui/501 [100007] + asid = 100007 + minimum runtime = 60 + exit timeout = 5 + runs = 311 + last exit code = 0 + + spawn type = daemon (3) + jetsam priority = 4 + jetsam memory limit (active) = (unlimited) + jetsam memory limit (inactive) = (unlimited) + jetsamproperties category = daemon + jetsam thread limit = 32 + cpumon = default + job state = exited + + properties = keepalive | runatload + } + """ + let expectedData = try XCTUnwrap(plist.data(using: .utf8)) + let expectedPlist = try XCTUnwrap(PropertyListSerialization.propertyList(from: expectedData, + format: nil) as? [String:Any]).customMirror + + let mockFm = MockFileManager() + Aftermath.fm = mockFm + mockFm.stubFileExists = { path in + XCTAssertEqual(path, url.relativePath) + return true + } + mockFm.stubContentsAtPath = { path in + XCTAssertEqual(path, url.relativePath) + return expectedData + } + + + // When + let actualPlist = Aftermath.getPlistAsDict(atUrl: url) + + // Then + XCTAssertEqual(expectedPlist.description, actualPlist.description) + } + + // MARK: dateFromEpochTimestamp + + // MARK: standardizeMetadataTimestamp + + // MARK: readCSVRows + + // MARK: sortCSV +} diff --git a/tests/mocks/MockFileManager.swift b/tests/mocks/MockFileManager.swift new file mode 100644 index 0000000..da4050b --- /dev/null +++ b/tests/mocks/MockFileManager.swift @@ -0,0 +1,21 @@ +// +// MockFileManager.swift +// aftermath +// +// Created by Maggie Zirnhelt on 8/25/22. +// + +import Foundation + +class MockFileManager: FileManager { + + var stubFileExists: ((String) -> Bool)? + override func fileExists(atPath: String) -> Bool { + stubFileExists!(atPath) + } + + var stubContentsAtPath: ((String) -> Data?)? + override func contents(atPath path: String) -> Data? { + stubContentsAtPath!(path) + } +} From ea611d057a394fc9d5b8d9480d5707a5959d9b39 Mon Sep 17 00:00:00 2001 From: c7bercat Date: Thu, 25 Aug 2022 15:44:02 -0500 Subject: [PATCH 2/8] adjust naming --- aftermath.xcodeproj/project.pbxproj | 30 +++++++------------ .../xcshareddata/xcschemes/aftermath.xcscheme | 2 +- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/aftermath.xcodeproj/project.pbxproj b/aftermath.xcodeproj/project.pbxproj index c976f03..219ba7f 100644 --- a/aftermath.xcodeproj/project.pbxproj +++ b/aftermath.xcodeproj/project.pbxproj @@ -48,8 +48,8 @@ A190FFD028B8084F00B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; A190FFD328B8094600B9EF9A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A190FFD228B8094600B9EF9A /* XCTest.framework */; }; A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; - A190FFDE28B8151300B9EF9A /* aftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFDD28B8151300B9EF9A /* aftermathTests.swift */; }; A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; + A190FFE328B8168400B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; A3046F8E27627DAC0069AA21 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8D27627DAC0069AA21 /* Module.swift */; }; A3046F902763AE5E0069AA21 /* CaseFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */; }; A3745358275730870074B65C /* LaunchItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3745357275730870074B65C /* LaunchItems.swift */; }; @@ -115,8 +115,7 @@ A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AftermathTests.swift; sourceTree = ""; }; A190FFD228B8094600B9EF9A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; A190FFD528B80C3900B9EF9A /* MockFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFileManager.swift; sourceTree = ""; }; - A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = aftermathTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A190FFDD28B8151300B9EF9A /* aftermathTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = aftermathTests.swift; sourceTree = ""; }; + A190FFDB28B8151300B9EF9A /* tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A3046F8D27627DAC0069AA21 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaseFiles.swift; sourceTree = ""; }; A3745357275730870074B65C /* LaunchItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchItems.swift; sourceTree = ""; }; @@ -315,14 +314,6 @@ path = mocks; sourceTree = ""; }; - A190FFDC28B8151300B9EF9A /* aftermathTests */ = { - isa = PBXGroup; - children = ( - A190FFDD28B8151300B9EF9A /* aftermathTests.swift */, - ); - path = aftermathTests; - sourceTree = ""; - }; A374535B2757C1110074B65C /* extensions */ = { isa = PBXGroup; children = ( @@ -348,7 +339,6 @@ 70A44401275707800035F40E /* systemRecon */, 8ABB9E2927568E9000C0ADD7 /* unifiedlogs */, A3A3A3CD274754B400F8F557 /* Readme.md */, - A190FFDC28B8151300B9EF9A /* aftermathTests */, A3CD4E53274434EE00869ECB /* Products */, A190FFD128B8094600B9EF9A /* Frameworks */, ); @@ -358,7 +348,7 @@ isa = PBXGroup; children = ( A3CD4E52274434EE00869ECB /* aftermath */, - A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */, + A190FFDB28B8151300B9EF9A /* tests.xctest */, ); name = Products; sourceTree = ""; @@ -379,9 +369,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - A190FFDA28B8151300B9EF9A /* aftermathTests */ = { + A190FFDA28B8151300B9EF9A /* tests */ = { isa = PBXNativeTarget; - buildConfigurationList = A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "aftermathTests" */; + buildConfigurationList = A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "tests" */; buildPhases = ( A190FFD728B8151300B9EF9A /* Sources */, A190FFD828B8151300B9EF9A /* Frameworks */, @@ -391,9 +381,9 @@ ); dependencies = ( ); - name = aftermathTests; + name = tests; productName = aftermathTests; - productReference = A190FFDB28B8151300B9EF9A /* aftermathTests.xctest */; + productReference = A190FFDB28B8151300B9EF9A /* tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; A3CD4E51274434EE00869ECB /* aftermath */ = { @@ -454,7 +444,7 @@ projectRoot = ""; targets = ( A3CD4E51274434EE00869ECB /* aftermath */, - A190FFDA28B8151300B9EF9A /* aftermathTests */, + A190FFDA28B8151300B9EF9A /* tests */, ); }; /* End PBXProject section */ @@ -474,8 +464,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A190FFE328B8168400B9EF9A /* AftermathTests.swift in Sources */, A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */, - A190FFDE28B8151300B9EF9A /* aftermathTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -737,7 +727,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "aftermathTests" */ = { + A190FFDF28B8151300B9EF9A /* Build configuration list for PBXNativeTarget "tests" */ = { isa = XCConfigurationList; buildConfigurations = ( A190FFE028B8151300B9EF9A /* Debug */, diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme index 2e8ee2c..6cad650 100644 --- a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme +++ b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme @@ -34,7 +34,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "A190FFDA28B8151300B9EF9A" BuildableName = "aftermathTests.xctest" - BlueprintName = "aftermathTests" + BlueprintName = "tests" ReferencedContainer = "container:aftermath.xcodeproj"> From 4f535a6088661b446d4bce4c74852a8dbd25e15c Mon Sep 17 00:00:00 2001 From: c7bercat Date: Fri, 26 Aug 2022 11:13:41 -0500 Subject: [PATCH 3/8] make this first test work --- aftermath.xcodeproj/project.pbxproj | 24 +++ .../xcshareddata/xcschemes/aftermath.xcscheme | 2 +- tests/aftermath/AftermathTests.swift | 54 +------ tests/resources/dummyPlist.plist | 138 ++++++++++++++++++ 4 files changed, 169 insertions(+), 49 deletions(-) create mode 100644 tests/resources/dummyPlist.plist diff --git a/aftermath.xcodeproj/project.pbxproj b/aftermath.xcodeproj/project.pbxproj index 219ba7f..d74e4f0 100644 --- a/aftermath.xcodeproj/project.pbxproj +++ b/aftermath.xcodeproj/project.pbxproj @@ -50,6 +50,9 @@ A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; A190FFE328B8168400B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; + A1E433D928B918FF00E2B510 /* Aftermath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ABB9E302756D2B500C0ADD7 /* Aftermath.swift */; }; + A1E433DB28B919A400E2B510 /* SwiftCSV in Frameworks */ = {isa = PBXBuildFile; productRef = A1E433DA28B919A400E2B510 /* SwiftCSV */; }; + A1E433E528B9270800E2B510 /* dummyPlist.plist in Resources */ = {isa = PBXBuildFile; fileRef = A1E433E428B9270800E2B510 /* dummyPlist.plist */; }; A3046F8E27627DAC0069AA21 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8D27627DAC0069AA21 /* Module.swift */; }; A3046F902763AE5E0069AA21 /* CaseFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */; }; A3745358275730870074B65C /* LaunchItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3745357275730870074B65C /* LaunchItems.swift */; }; @@ -116,6 +119,7 @@ A190FFD228B8094600B9EF9A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; A190FFD528B80C3900B9EF9A /* MockFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFileManager.swift; sourceTree = ""; }; A190FFDB28B8151300B9EF9A /* tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A1E433E428B9270800E2B510 /* dummyPlist.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = dummyPlist.plist; sourceTree = ""; }; A3046F8D27627DAC0069AA21 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaseFiles.swift; sourceTree = ""; }; A3745357275730870074B65C /* LaunchItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchItems.swift; sourceTree = ""; }; @@ -131,6 +135,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A1E433DB28B919A400E2B510 /* SwiftCSV in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -284,6 +289,7 @@ A190FFCD28B8080100B9EF9A /* tests */ = { isa = PBXGroup; children = ( + A1E433DE28B91E2C00E2B510 /* resources */, A190FFD428B80C2D00B9EF9A /* mocks */, A190FFCE28B8083600B9EF9A /* aftermath */, ); @@ -314,6 +320,14 @@ path = mocks; sourceTree = ""; }; + A1E433DE28B91E2C00E2B510 /* resources */ = { + isa = PBXGroup; + children = ( + A1E433E428B9270800E2B510 /* dummyPlist.plist */, + ); + path = resources; + sourceTree = ""; + }; A374535B2757C1110074B65C /* extensions */ = { isa = PBXGroup; children = ( @@ -382,6 +396,9 @@ dependencies = ( ); name = tests; + packageProductDependencies = ( + A1E433DA28B919A400E2B510 /* SwiftCSV */, + ); productName = aftermathTests; productReference = A190FFDB28B8151300B9EF9A /* tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -454,6 +471,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A1E433E528B9270800E2B510 /* dummyPlist.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -464,6 +482,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A1E433D928B918FF00E2B510 /* Aftermath.swift in Sources */, A190FFE328B8168400B9EF9A /* AftermathTests.swift in Sources */, A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */, ); @@ -786,6 +805,11 @@ package = A0C930D528A543F80011FB87 /* XCRemoteSwiftPackageReference "SwiftCSV" */; productName = SwiftCSV; }; + A1E433DA28B919A400E2B510 /* SwiftCSV */ = { + isa = XCSwiftPackageProductDependency; + package = A0C930D528A543F80011FB87 /* XCRemoteSwiftPackageReference "SwiftCSV" */; + productName = SwiftCSV; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = A3CD4E4A274434EE00869ECB /* Project object */; diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme index 6cad650..5b10a3b 100644 --- a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme +++ b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme @@ -33,7 +33,7 @@ diff --git a/tests/aftermath/AftermathTests.swift b/tests/aftermath/AftermathTests.swift index 1e313e2..4fb5602 100644 --- a/tests/aftermath/AftermathTests.swift +++ b/tests/aftermath/AftermathTests.swift @@ -21,49 +21,12 @@ class AftermathTests: XCTestCase { func testGetPlistAsDict() throws { // Given - let url = try XCTUnwrap(URL(string: UUID().uuidString)) - let plist = - """ - gui/501/com.jamf.protect.agent = { - active count = 0 - path = /Library/LaunchAgents/com.jamf.protect.agent.plist - state = spawn scheduled - - program = /Applications/JamfProtect.app/Contents/Helpers/JamfProtectAgent.app/Contents/MacOS/JamfProtectAgent - inherited environment = { - SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.oi4pZOD54K/Listeners - } - - default environment = { - PATH => /usr/bin:/bin:/usr/sbin:/sbin - } - - environment = { - XPC_SERVICE_NAME => com.jamf.protect.agent - } - - domain = gui/501 [100007] - asid = 100007 - minimum runtime = 60 - exit timeout = 5 - runs = 311 - last exit code = 0 - - spawn type = daemon (3) - jetsam priority = 4 - jetsam memory limit (active) = (unlimited) - jetsam memory limit (inactive) = (unlimited) - jetsamproperties category = daemon - jetsam thread limit = 32 - cpumon = default - job state = exited - - properties = keepalive | runatload - } - """ - let expectedData = try XCTUnwrap(plist.data(using: .utf8)) + let path = try XCTUnwrap(Bundle(for: type(of : self)).path(forResource: "dummyPlist.plist", + ofType: nil)) + let url = try XCTUnwrap(URL(fileURLWithPath: path)) + let expectedData = try Data(contentsOf: url) let expectedPlist = try XCTUnwrap(PropertyListSerialization.propertyList(from: expectedData, - format: nil) as? [String:Any]).customMirror + format: nil) as? [String:Any]) let mockFm = MockFileManager() Aftermath.fm = mockFm @@ -71,17 +34,12 @@ class AftermathTests: XCTestCase { XCTAssertEqual(path, url.relativePath) return true } - mockFm.stubContentsAtPath = { path in - XCTAssertEqual(path, url.relativePath) - return expectedData - } - // When let actualPlist = Aftermath.getPlistAsDict(atUrl: url) // Then - XCTAssertEqual(expectedPlist.description, actualPlist.description) + XCTAssertEqual(actualPlist.description, expectedPlist.description) } // MARK: dateFromEpochTimestamp diff --git a/tests/resources/dummyPlist.plist b/tests/resources/dummyPlist.plist new file mode 100644 index 0000000..451bc6b --- /dev/null +++ b/tests/resources/dummyPlist.plist @@ -0,0 +1,138 @@ + + + + + New item + + PayloadContent + + + AllowAllAppsAccess + + KeyIsExtractable + + PayloadCertificateFileName + rootCA.der + PayloadContent + MIIB7TCCAZOgAwIBAgIUKIhytiqJFwJQQVC9FavXbJ1OM6UwCgYIKoZIzj0EAwIwbDEfMB0GA1UEAwwWbWFnZ2llemlybmhlbHQucHJvdGVjdDENMAsGA1UECgwESmFtZjE6MDgGA1UECwwxSmFtZiBQcm90ZWN0IGUxN2EzYjIyLWM2NDktNDM2NS04ZDk3LWUzNWRjZDJkMmEwNDAeFw0yMjA4MjMxMzM4MzlaFw00MjA4MTgxMzM4MzlaMGwxHzAdBgNVBAMMFm1hZ2dpZXppcm5oZWx0LnByb3RlY3QxDTALBgNVBAoMBEphbWYxOjA4BgNVBAsMMUphbWYgUHJvdGVjdCBlMTdhM2IyMi1jNjQ5LTQzNjUtOGQ5Ny1lMzVkY2QyZDJhMDQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT0oFJzImjdNKXr24U4RvzLQCJV6sYERH/LZgaI3DoMksQUul1sB2yQ//NhHSbJY8C/c0vRi6th7YtXhcMWeLQloxMwETAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMCA0gAMEUCIFqTxU3K1/r+ioyFcMoaam1BCyrHD5OtTJPtXW6qP1XqAiEAnLJgyMUgGVsvIZbWYCqZ3jxOfS46RQCIraWiqGkYbFQ= + PayloadDescription + CA Certificate for Jamf Protect + PayloadDisplayName + Jamf Protect Root CA + PayloadIdentifier + 47f03068-e486-4051-b447-8130a93bb886 + PayloadOrganization + Jamf Protect + PayloadType + com.apple.security.root + PayloadUUID + 47f03068-e486-4051-b447-8130a93bb886 + PayloadVersion + 1 + + + AllowAllAppsAccess + + KeyIsExtractable + + Password + gameplan + PayloadCertificateFileName + csr.p12 + PayloadContent + MIIEzAIBAzCCBJYGCSqGSIb3DQEHAaCCBIcEggSDMIIEfzCCAv8GCSqGSIb3DQEHBqCCAvAwggLsAgEAMIIC5QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQIRqLGmdF+sdQCAk4ggIICuDL7qiken8QkzjWbOWrpHyXgZyfRjI3fyfKf1iXa7QxK3YumrKQ/y7kudJvGZ3DRmXOnAWLSPKt5hBUnpoHRbX8S62TpCHVdaN/2PFu8Sx9X0kyP2wCh22oSRiSV+o3Tzi3dsUsjRKRfbECffoJeoK6oCjeMo5nMIY11a908Md3L82Z+0YeHSOiqJ5VGVR1YX8LrWmxGXvpGEYV/iIL2uwcWTOrJ20Bf66UD6/rTGerWcW91FNu7BkkFFLwkkNzXMjXkFuVjc17LfmiDLoc0qQ7k9v5FJoZiJNOTvCxTIsSH7CaREVkXli0daUN9itP/LhHLyoNiRkNU489oVKxcXrQ48mRkdvtODdndnXe4oHvOsTfduJGScobQ20WJkzKfV45loFhW3WYU95jqPP4D7MlmWrzBZl0wuM9BhZGkRUbUgtRoUvd3/qFVvbDyn2mZuFqGk0oJDZjA2ZnwaHBqr2yB4gIFgUr884fpJlsP2FAX83ic4h5cQzdzNQOstH2dVIDd93nRXSWHWpKhFg1V7Q9D0z5Q3vsEKu7qLPU/TY5lhiif/KdoLCQIjlHR5IZBUnW5lBkIDNTtIRMshd/T//Qz4HEB3FmlqMJ/WEZH2U6bBZIfNPB0QX42kpEoc7KTFT7+hX+l76CcERyTwvBjcc5hd+X30bWLGK/CCQO1G1PIOM6XyCsus1YdWLyCkaYzbjfp95J5r0z5kbPsWBYgp4C7vDf7qTl6Rskdnj567p6WOZE2WvwctISsweJt7pubcaf1eHUqpkgK+rxnhU6xy2aDTsjGQPwKVR+cTnnV+V/4chcQetJnpC205iRET9dW9WoFtmBKC+qRoyt6klX5mzLPakTsx9ugBq4TYLMP9ghg+087cAal8Su+a961NF5IOJ70+TV9DPMGePJXLjzhZTm2XRd9Yyos4DCCAXgGCSqGSIb3DQEHAaCCAWkEggFlMIIBYTCCAV0GCyqGSIb3DQEMCgECoIG0MIGxMBwGCiqGSIb3DQEMAQMwDgQIvNZxsLFVGHoCAk4gBIGQOwuHhdHMNp9TKKg8Qb+tVINwsnSeUBemFMWY3tAueprdmgbwyE1LtI4YrlJUxnswcvqBBWpBiKaoDAgRGTDSInopQGLGn0Pmpym2BuBexHYRAhUJFLf4t1SSJ+M/ChB55TANGyRMiRqr03BSc3GTJ/gn/dfON+zcjZ9r1tnqaeuAUXwwVoduZR/LqLZSu/6mMYGWMCMGCSqGSIb3DQEJFTEWBBRlescFqRGITvdPeclVkk/iBcSP6DBvBgkqhkiG9w0BCRQxYh5gAG0AYQBnAGcAaQBlAHoAaQByAG4AaABlAGwAdAAuAHAAcgBvAHQAZQBjAHQAIABKAGEAbQBmACAAUAByAG8AdABlAGMAdAAgAEMAUwBSACAASQBkAGUAbgB0AGkAdAB5MC0wITAJBgUrDgMCGgUABBRphGcSzDZ6mQJpDXCrjgKtmYS7XgQIu9Cn+A0eZlw= + PayloadDescription + CSR for Jamf Protect + PayloadDisplayName + Jamf Protect CSR + PayloadIdentifier + d53cf4ba-1827-44cf-a97e-16d614315823 + PayloadOrganization + Jamf Protect + PayloadType + com.apple.security.pkcs12 + PayloadUUID + d53cf4ba-1827-44cf-a97e-16d614315823 + PayloadVersion + 1 + + + AllowAllAppsAccess + + KeyIsExtractable + + Password + gameplan + PayloadCertificateFileName + iotCustomAuthPrivateKey.p12 + PayloadContent + MIIFvAIBAzCCBYYGCSqGSIb3DQEHAaCCBXcEggVzMIIFbzCCBWsGCSqGSIb3DQEHAaCCBVwEggVYMIIFVDCCBVAGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhfgJamIXELJQICTiAEggTIrXcVHWNerSiXuqQCYkvpSzoRRphu9613IcuGBeXAbceGYs++VJyZMD2OSdcStcn4HOH/7EqyRpSHKH3GdrgNAIlL3T1+Oj5GIIF/D2GfxjGvrAFKMPQpmPiK/vFBpHssDVKDUlK6NxJP9SpuPhEKVWL8ciKQcTVYX3j1RMHRbxDcn3DyMX7y5xJ68rOcZY0FAlZrSLfpP5x3GJ2ZquKg6BEq0KMP0MPEZJPsX4s17Vt6v/F1JtbPzBCj/SW/00i4boCEVs7MmftWn5I7Evh43i8Gc2p/058BzMJe/tdpzf98IGSi1zkSNbcDgwgC0t/1nty1enEniHnB7Y4TP2kvN/hxLs1qXunQ7+uBsvdkdXqjyB0s53opPMCIfO7K9hSl2PQn2cgYpRZvQrkRQX/wVaDMztSB/VPBOdtRfTTsZRWvP5yYT4Npgi054+Ha7l0yXKemdGU5+O8ZyoOLSWnzcVrp/syOIfimi7vClyfuqfmCqySec9dN7+Cl1NufnMu3KF3hqkYftaR/isHSGnT5lqxWwZVlQXMLD6bkDNWCYpY4Cbx+timVy/tDoZWxTp5vkNu/EBMae3x1dQrPdSxlzY/nKhV0QRLslB8kbKTIk+iBz4PsOM3ETmgnoSRMjdvNT9sFoOK88kG0Gs+Ql0l9tRBlHM7dkR3viztqdVjGFyJ2TKEzl8688avBD4RklSKmH1alWAZ5fG7AUqsUct5U+xs9WsSPxCz/0mko2RsZJNpH98jSRH3fjNFSMbNws5YOKgn7L4wQ74WpERWegf/CTxwpgTtcFPm/kTnwpldeodF0sJ6f3ouzEaVt6XMYlnS+wj5rfa3Wvf41q9nwEbI4tn23WQw6/90SXv10I4khb6SK1DFkc3VbXy80sAnH5t6mbed7baTIdvjdpmPk3aaMEz3PtqmVO98T+fGV+w02ptp0AYE3fN6v81hq0CQs1E//uh9YIp0xc0/yzDCJlKgTvhIkFt2argeT5ylwkYAA3ui1S+Dx3umK+SQp1kgMT2A7QskDJ2ZLc88Aia4zUmjVl3EL3YFN9DTKTIQJMaMglJZcSSHjuZAJG0enzwHnXSV8yve08sol9az7OhtCAS4FpXl597qPU0uj5oroMF2OvZEqZtbwCNMwhFYgkUsPJPN3DYVEBR9JepFDJcx7EuHsESusOJbGnbUdzVpsEmNHiQpnAM+IrynCrcnixwcT53+3BVChRazgCkHx+yqewltCm91NS3WWrwZNlG+lzoI/D4YG1TqZQfZKBbUy4j18uLxNDifFUtrLEsh8Rssyi951BaAoEEdvSpu+Y1oKD3tQbr5H6eCKisSsxUxoOE2A/tb8JKcZmIFzC+tJkE1ONpjD0gPuFu3LomNiYgo3D3vvQG9UfKZBOpUeDRnsdWwcg+Tpgkfr5KXx5FA338dTdq70tJ+VOGmfgayvlSi6WUY5m6/rYLHdcmtCrGm6kvStHyl42dXZQM1yjwTq8fOleahsS+kZEJ8UHViYq82/Bkryc9pOCkaFAp0GkJvbYSjqmj9ejfzPNZqBFJlbN5qpbGZ+rlCwzOfxR3orBWpUkQaHPZHuWt/IpiY/L73bptyCQ4fo7tJxTmAjE2NiVztZj7jaD+QSxSmKm4+dMU8wTQYJKoZIhvcNAQkUMUAePgBKAGEAbQBmACAAUAByAG8AdABlAGMAdAAgAFcAUwBTACAAQQB1AHQAaABvAHIAaQB6AGUAcgAgAEsAZQB5MC0wITAJBgUrDgMCGgUABBTwYpxmnXtMMMgKrssqkvAKTZeMdgQIVhpG+GHO38M= + PayloadDescription + Certificate for Jamf Protect to be able to communicate over websockets + PayloadDisplayName + Websocket Authentication Certificate + PayloadIdentifier + 61d949ea-dfd3-4a51-b30e-3f41975ad6bd + PayloadOrganization + Jamf Protect + PayloadType + com.apple.security.pkcs12 + PayloadUUID + 61d949ea-dfd3-4a51-b30e-3f41975ad6bd + PayloadVersion + 1 + + + PayloadContent + + com.jamf.protect + + Forced + + + mcx_preference_settings + + bootstrapToken + eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpYXQiOjE2NjEyNzIzNjguNTQ4NDM0LCJsb2dMZXZlbCI6InZlcmJvc2UiLCJjc3JpZCI6IjJhYjJiZTZhNjEwYTkzNzUwMmJkNjc5NDRkNTMzYjA0MjY2YWIxYWI1YmE4NWZjYjMyMTY4NjJlZGQwMzJiZmEiLCJjYWlkIjoiODU1N2IxOGI3M2ZmNzQ1MTUxYjdhNjRlNDRhODEyZTYyYzFhNDhlOGFkZjRkM2RmNWMwYjExNzA0NmYwNWMyZCIsImNvbmZpZ2lkIjo3LCJ0b3BpY2lkIjoianB0LWlvdC1BRUctNDIwMiIsImNvbW1zUHJvdG9jb2wiOiJ3c3MvbXF0dCIsInVybCI6ImFoNmpybW8yMTd6ODctYXRzLmlvdC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbSIsImlvdF9jdXN0b21fYXV0aF9uYW1lIjoicHJvdGVjdC1hZWctNDIwMiJ9.I4RykdDvX0m0d0FWykLQ6hzu6RKqViD4X-rdDeS8KhLwl16_LhpDSoeModG6qPlb45s1UVBRsVhAaPgQKvjaCg + + + + + + PayloadDescription + Jamf Protect Plan configuration + PayloadDisplayName + Jamf Protect Config + PayloadIdentifier + e2c9421d-98ed-41fa-beda-b8c960c71b36 + PayloadOrganization + Jamf + PayloadType + com.apple.ManagedClient.preferences + PayloadUUID + e2c9421d-98ed-41fa-beda-b8c960c71b36 + PayloadVersion + 1 + + + PayloadDescription + Jamf Protect Certificates and PPPC Configuration Plans + PayloadDisplayName + 4202 maggie wss Plan - Jamf Protect Configuration + PayloadIdentifier + com.jamf.protect.0c8a2f58-66f2-4103-96c4-3a62744c6bf2 + PayloadOrganization + Jamf Protect + PayloadRemovalDisallowed + + PayloadScope + System + PayloadType + Configuration + PayloadUUID + 0c8a2f58-66f2-4103-96c4-3a62744c6bf2 + PayloadVersion + 1 + + + From 7c4e0d58cff7514ea822cf7fd665eb3a590ac9a9 Mon Sep 17 00:00:00 2001 From: c7bercat Date: Tue, 30 Aug 2022 14:56:27 -0500 Subject: [PATCH 4/8] finish some tests --- tests/aftermath/AftermathTests.swift | 53 ++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/tests/aftermath/AftermathTests.swift b/tests/aftermath/AftermathTests.swift index 4fb5602..5d71804 100644 --- a/tests/aftermath/AftermathTests.swift +++ b/tests/aftermath/AftermathTests.swift @@ -6,17 +6,10 @@ // import XCTest +import SwiftCSV class AftermathTests: XCTestCase { - override func setUpWithError() throws { - - } - - override func tearDownWithError() throws { - - } - // MARK: getPlistAsDict func testGetPlistAsDict() throws { @@ -44,9 +37,49 @@ class AftermathTests: XCTestCase { // MARK: dateFromEpochTimestamp - // MARK: standardizeMetadataTimestamp + func testDateFromEpochTimestamp() { + // Given + let date = Date.distantFuture.timeIntervalSince1970 - // MARK: readCSVRows + // When + let actualDate = Aftermath.dateFromEpochTimestamp(timeStamp: date) + + // Then + XCTAssertEqual(actualDate, "4001-01-01T00:00:00") + } + + // MARK: dateFromEpochTimestamp + + func testStandardizeMetadataTimestamp() { + // Given + let date = Date.distantFuture + + // When + let actualDate = Aftermath.standardizeMetadataTimestamp(timeStamp: "\(date)") + + // Then + XCTAssertEqual(actualDate, "4001-01-01T00:00:00") + } // MARK: sortCSV + + func testSortCSVWithDateFromEpochTimestamp() throws { + // Given + let oldestDate = Date.distantPast + let middleDate = Date() + let newestDate = Date.distantFuture + + let oldestTimestamp = Aftermath.dateFromEpochTimestamp(timeStamp: oldestDate.timeIntervalSince1970) + let middlestTimestamp = Aftermath.dateFromEpochTimestamp(timeStamp: middleDate.timeIntervalSince1970) + let newestTimestamp = Aftermath.dateFromEpochTimestamp(timeStamp: newestDate.timeIntervalSince1970) + + let unsortedArr = [["\(middlestTimestamp)"], ["\(newestTimestamp)"], ["\(oldestTimestamp)"]] + let expectedSortedArr = [["\(newestTimestamp)"], ["\(middlestTimestamp)"], ["\(oldestTimestamp)"]] + + // When + let actualSortedArr = try Aftermath.sortCSV(unsortedArr: unsortedArr) + + // Then + XCTAssertEqual(actualSortedArr, expectedSortedArr) + } } From 62237f52f3b8761562404b674b970d12c75ff595 Mon Sep 17 00:00:00 2001 From: c7bercat Date: Tue, 30 Aug 2022 14:57:43 -0500 Subject: [PATCH 5/8] remove example test file --- aftermathTests/aftermathTests.swift | 35 ----------------------------- 1 file changed, 35 deletions(-) delete mode 100644 aftermathTests/aftermathTests.swift diff --git a/aftermathTests/aftermathTests.swift b/aftermathTests/aftermathTests.swift deleted file mode 100644 index 53b4cc4..0000000 --- a/aftermathTests/aftermathTests.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// aftermathTests.swift -// aftermathTests -// -// Created by Maggie Zirnhelt on 8/25/22. -// - -import XCTest - -class aftermathTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - // Any test you write for XCTest can be annotated as throws and async. - // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. - // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - measure { - // Put the code you want to measure the time of here. - } - } - -} From ff799c26a773b76294c29ce588213b5c6dfe405c Mon Sep 17 00:00:00 2001 From: c7bercat Date: Tue, 30 Aug 2022 15:07:17 -0500 Subject: [PATCH 6/8] this scheme was removed in a recent pr --- .../xcshareddata/xcschemes/aftermath.xcscheme | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme deleted file mode 100644 index 5b10a3b..0000000 --- a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 9214d5f06503305fcca5994cd54452fe35b7ffff Mon Sep 17 00:00:00 2001 From: stuartjash Date: Wed, 31 Aug 2022 10:13:00 -0700 Subject: [PATCH 7/8] fixed issue with scheme conflicts --- .gitignore | 1 - aftermath.xcodeproj/project.pbxproj | 23 ++-- .../xcshareddata/xcschemes/aftermath.xcscheme | 103 ++++++++++++++++++ .../xcshareddata/xcschemes/tests.xcscheme | 52 +++++++++ 4 files changed, 166 insertions(+), 13 deletions(-) create mode 100644 aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme create mode 100644 aftermath.xcodeproj/xcshareddata/xcschemes/tests.xcscheme diff --git a/.gitignore b/.gitignore index d815c71..c9f30cb 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ xcuserdata/ *.xccheckout *.xcscmblueprint *.profraw -*.xcscheme ## Obj-C/Swift specific *.hmap diff --git a/aftermath.xcodeproj/project.pbxproj b/aftermath.xcodeproj/project.pbxproj index 5f7dd31..0cc7eac 100644 --- a/aftermath.xcodeproj/project.pbxproj +++ b/aftermath.xcodeproj/project.pbxproj @@ -45,15 +45,13 @@ A0E1E3F6275ED2E4008D0DC6 /* NetworkModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E1E3F5275ED2E4008D0DC6 /* NetworkModule.swift */; }; A0E1E3F8275ED35D008D0DC6 /* NetworkConnections.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E1E3F7275ED35D008D0DC6 /* NetworkConnections.swift */; }; A0E22EF2285CD60A003A411A /* CommonDirectories.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E22EF1285CD60A003A411A /* CommonDirectories.swift */; }; - A190FFD028B8084F00B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; - A190FFD328B8094600B9EF9A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A190FFD228B8094600B9EF9A /* XCTest.framework */; }; - A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; + A0FAEEFE28B94B2C00AC655F /* LogParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0FAEEFD28B94B2C00AC655F /* LogParser.swift */; }; + A190FFD328B8094600B9EF9A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A190FFD228B8094600B9EF9A /* XCTest.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; A190FFE228B8151F00B9EF9A /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFD528B80C3900B9EF9A /* MockFileManager.swift */; }; A190FFE328B8168400B9EF9A /* AftermathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */; }; A1E433D928B918FF00E2B510 /* Aftermath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ABB9E302756D2B500C0ADD7 /* Aftermath.swift */; }; A1E433DB28B919A400E2B510 /* SwiftCSV in Frameworks */ = {isa = PBXBuildFile; productRef = A1E433DA28B919A400E2B510 /* SwiftCSV */; }; A1E433E528B9270800E2B510 /* dummyPlist.plist in Resources */ = {isa = PBXBuildFile; fileRef = A1E433E428B9270800E2B510 /* dummyPlist.plist */; }; - A0FAEEFE28B94B2C00AC655F /* LogParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0FAEEFD28B94B2C00AC655F /* LogParser.swift */; }; A3046F8E27627DAC0069AA21 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8D27627DAC0069AA21 /* Module.swift */; }; A3046F902763AE5E0069AA21 /* CaseFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */; }; A3745358275730870074B65C /* LaunchItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3745357275730870074B65C /* LaunchItems.swift */; }; @@ -114,13 +112,12 @@ A0E1E3F5275ED2E4008D0DC6 /* NetworkModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkModule.swift; sourceTree = ""; }; A0E1E3F7275ED35D008D0DC6 /* NetworkConnections.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkConnections.swift; sourceTree = ""; }; A0E22EF1285CD60A003A411A /* CommonDirectories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonDirectories.swift; sourceTree = ""; }; - A0E46B8A288F55A600975EC8 /* aftermath.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = aftermath.entitlements; sourceTree = ""; }; + A0FAEEFD28B94B2C00AC655F /* LogParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogParser.swift; sourceTree = ""; }; A190FFCF28B8084F00B9EF9A /* AftermathTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AftermathTests.swift; sourceTree = ""; }; A190FFD228B8094600B9EF9A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; A190FFD528B80C3900B9EF9A /* MockFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFileManager.swift; sourceTree = ""; }; A190FFDB28B8151300B9EF9A /* tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A1E433E428B9270800E2B510 /* dummyPlist.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = dummyPlist.plist; sourceTree = ""; }; - A0FAEEFD28B94B2C00AC655F /* LogParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogParser.swift; sourceTree = ""; }; A3046F8D27627DAC0069AA21 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; A3046F8F2763AE5E0069AA21 /* CaseFiles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaseFiles.swift; sourceTree = ""; }; A3745357275730870074B65C /* LaunchItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchItems.swift; sourceTree = ""; }; @@ -514,7 +511,6 @@ A029AB2B2877F52D00649701 /* launchdXPC.m in Sources */, A0E1E3EF275EC810008D0DC6 /* Safari.swift in Sources */, A006B5A12882FBA70091FAA1 /* DatabaseParser.swift in Sources */, - A190FFD028B8084F00B9EF9A /* AftermathTests.swift in Sources */, 70A44405275A76990035F40E /* LSQuarantine.swift in Sources */, A374535D2757C1300074B65C /* FileManager.swift in Sources */, A09B239C2848F6050062D592 /* Periodic.swift in Sources */, @@ -530,7 +526,6 @@ A0E1E3F6275ED2E4008D0DC6 /* NetworkModule.swift in Sources */, A076742C27555FC100ED7066 /* PersistenceModule.swift in Sources */, A0D6D54727FE147D002BB3C8 /* Overrides.swift in Sources */, - A190FFD628B80C3900B9EF9A /* MockFileManager.swift in Sources */, A0D6D54927FE52C1002BB3C8 /* SystemExtensions.swift in Sources */, A08342D6284A8247005E437A /* AnalysisModule.swift in Sources */, A029AB192876A29600649701 /* Pids.swift in Sources */, @@ -546,9 +541,10 @@ A190FFE028B8151300B9EF9A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 483DWKW443; + DEVELOPMENT_TEAM = 6PV5YF2UES; GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 12.3; MARKETING_VERSION = 1.0; @@ -562,9 +558,10 @@ A190FFE128B8151300B9EF9A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 483DWKW443; + DEVELOPMENT_TEAM = 6PV5YF2UES; GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 12.3; MARKETING_VERSION = 1.0; @@ -628,6 +625,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LD_RUNPATH_SEARCH_PATHS = /Applications/Xcode.app/Contents/Developer/Library/Frameworks/; MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -685,6 +683,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LD_RUNPATH_SEARCH_PATHS = /Applications/Xcode.app/Contents/Developer/Library/Frameworks/; MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -702,7 +701,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = YES; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = 483DWKW443; + DEVELOPMENT_TEAM = 6PV5YF2UES; ENABLE_HARDENED_RUNTIME = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -728,7 +727,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = YES; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = 483DWKW443; + DEVELOPMENT_TEAM = 6PV5YF2UES; ENABLE_HARDENED_RUNTIME = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme new file mode 100644 index 0000000..3dc2bf3 --- /dev/null +++ b/aftermath.xcodeproj/xcshareddata/xcschemes/aftermath.xcscheme @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aftermath.xcodeproj/xcshareddata/xcschemes/tests.xcscheme b/aftermath.xcodeproj/xcshareddata/xcschemes/tests.xcscheme new file mode 100644 index 0000000..722211f --- /dev/null +++ b/aftermath.xcodeproj/xcshareddata/xcschemes/tests.xcscheme @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + From 3b3b4e16de7daaf7a9ce6301e43e3ba78c04981a Mon Sep 17 00:00:00 2001 From: stuartjash Date: Wed, 31 Aug 2022 10:29:20 -0700 Subject: [PATCH 8/8] added jamf copyright --- tests/aftermath/AftermathTests.swift | 2 +- tests/mocks/MockFileManager.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/aftermath/AftermathTests.swift b/tests/aftermath/AftermathTests.swift index 5d71804..c77e4dd 100644 --- a/tests/aftermath/AftermathTests.swift +++ b/tests/aftermath/AftermathTests.swift @@ -2,7 +2,7 @@ // AftermathTests.swift // aftermath // -// Created by Maggie Zirnhelt on 8/25/22. +// Copyright 2022 JAMF Software, LLC // import XCTest diff --git a/tests/mocks/MockFileManager.swift b/tests/mocks/MockFileManager.swift index da4050b..296049b 100644 --- a/tests/mocks/MockFileManager.swift +++ b/tests/mocks/MockFileManager.swift @@ -2,7 +2,7 @@ // MockFileManager.swift // aftermath // -// Created by Maggie Zirnhelt on 8/25/22. +// Copyright 2022 JAMF Software, LLC // import Foundation