Skip to content

Commit

Permalink
Fix binary enable-device-protection test
Browse files Browse the repository at this point in the history
  • Loading branch information
monkbroc committed Jun 21, 2024
1 parent e61fc1a commit 0e335e5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/e2e/binary.e2e.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const { expect } = require('../setup');
const cli = require('../lib/cli');
const fs = require('fs-extra');
const {
PATH_FIXTURES_BINARIES_DIR, PATH_FIXTURES_THIRDPARTY_OTA_DIR
} = require('../lib/env');
Expand Down Expand Up @@ -238,14 +239,16 @@ describe('Binary Commands', () => {

describe('Binary Subcommand to created a protected bootloader', () => {
it('Creates a protected bootloader', async () => {
const bootloader = path.join(PATH_FIXTURES_BINARIES_DIR, 'argon-bootloader-610.bin');
const args = ['binary', 'enable-device-protection', bootloader];
const { stdout, stderr, exitCode } = await cli.run(args);
expect(stdout).to.equal('argon-bootloader-610-protected.bin\n');
expect(stderr).to.equal('');
expect(exitCode).to.equal(0);

await fs.remove(path.join(PATH_FIXTURES_BINARIES_DIR, 'argon-bootloader-610-protected.bin'));
try {
const bootloader = path.join(PATH_FIXTURES_BINARIES_DIR, 'argon-bootloader-610.bin');
const args = ['binary', 'enable-device-protection', bootloader];
const { stdout, stderr, exitCode } = await cli.run(args);
expect(stdout).to.include('argon-bootloader-610-protected.bin');
expect(stderr).to.equal('');
expect(exitCode).to.equal(0);
} finally {
await fs.remove(path.join(PATH_FIXTURES_BINARIES_DIR, 'argon-bootloader-610-protected.bin'));
}
});
});
});
Expand Down

0 comments on commit 0e335e5

Please sign in to comment.