Skip to content

Commit

Permalink
add debug log
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
  • Loading branch information
JeffreyDallas committed Apr 10, 2024
1 parent bbff7a5 commit d3194ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/core/key_manager.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,31 @@ describe('KeyManager', () => {
const keytoolDepManager = new KeytoolDependencyManager(downloader, zippy, testLogger)
await keytoolDepManager.checkVersion()
const keytool = new Keytool(testLogger)
testLogger.showUser("step 1")

Check failure on line 120 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote
for (const nodeId of nodeIds) {
const result = await keyManager.generatePrivatePfxKeys(keytool, nodeId, keysDir, tmpDir)
testLogger.showUser("key node: " + nodeId + " result: " + result)

Check failure on line 123 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote

Check failure on line 123 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote
const expectedPrivatePfx = path.join(keysDir, `private-${nodeId}.pfx`)
expect(result).toStrictEqual(expectedPrivatePfx)
expect(fs.existsSync(expectedPrivatePfx)).toBeTruthy()
const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${expectedPrivatePfx}`)
testLogger.showUser("key node: " + nodeId + " output: " + output)

Check failure on line 128 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote

Check failure on line 128 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote
expect(output.includes('Your keystore contains 3 entries')).toBeTruthy()
}
testLogger.showUser("step 2")

Check failure on line 131 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote

const result = await keyManager.updatePublicPfxKey(keytool, nodeIds, keysDir, tmpDir)
const expectedPublicPfx = path.join(keysDir, constants.PUBLIC_PFX)
expect(result).toStrictEqual(expectedPublicPfx)
expect(fs.existsSync(expectedPublicPfx)).toBeTruthy()
testLogger.showUser("stp 3")

Check failure on line 137 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote

const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${expectedPublicPfx}`)
expect(output.includes('Your keystore contains 9 entries')).toBeTruthy()
testLogger.showUser("step 4")

Check failure on line 141 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Strings must use singlequote

fs.rmSync(keysDir, { recursive: true })
fs.rmSync(tmpDir, { recursive: true })
}, 60000)
})

Check failure on line 147 in test/unit/core/key_manager.test.mjs

View workflow job for this annotation

GitHub Actions / Code Style / Check

Too many blank lines at the end of file. Max of 0 allowed

0 comments on commit d3194ac

Please sign in to comment.