Skip to content

Commit

Permalink
tests: os: send secure boot artifacts before flashing
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Ryan Cooke <ryan@balena.io>
  • Loading branch information
rcooke-warwick committed Jun 14, 2024
1 parent 26fbc2e commit 92a14f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/suites/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ module.exports = [
}
},
image: `${__dirname}/balena-image.docker`,
// This is the name of a folder or file containing extra artifacts needed for secure-boot provisioning
// E.g for the cm4-io-board the `secure-boot-msd` folder is required
// This is the name of a folder or file containing extra artifacts needed for the test suite
// E.g for the cm4-io-board provisioning the `secure-boot-msd` folder is required
// This artifact/artifact must be copied into the `suites` folder before running the test
sbArtifacts: process.env.SB_ARTIFACTS,
artifacts: process.env.ARTIFACTS,
debug: {
// Exit the ongoing test suite if a test fails
failFast: true,
Expand Down Expand Up @@ -59,10 +59,10 @@ module.exports = [
// Mark unstable tests to be skipped
unstable: ['']
},
// This is the name of a folder or file containing extra artifacts needed for secure-boot provisioning
// E.g for the cm4-io-board the `secure-boot-msd` folder is required
// This is the name of a folder or file containing extra artifacts needed for the test suite
// E.g for the cm4-io-board provisioning the `secure-boot-msd` folder is required
// This artifact/artifact must be copied into the `suites` folder before running the test
sbArtifacts: process.env.SB_ARTIFACTS,
artifacts: process.env.ARTIFACTS,
workers: process.env.WORKER_TYPE === 'qemu' ? ['http://worker'] : {
balenaApplication: process.env.BALENACLOUD_APP_NAME.split(','),
apiKey: process.env.BALENACLOUD_API_KEY,
Expand All @@ -83,10 +83,10 @@ module.exports = [
}
},
image: `${__dirname}/balena.img.gz`,
// This is the name of a folder or file containing extra artifacts needed for secure-boot provisioning
// E.g for the cm4-io-board the `secure-boot-msd` folder is required
// This is the name of a folder or file containing extra artifacts needed for the test suite
// E.g for the cm4-io-board provisioning the `secure-boot-msd` folder is required
// This artifact/artifact must be copied into the `suites` folder before running the test
sbArtifacts: process.env.SB_ARTIFACTS,
artifacts: process.env.ARTIFACTS,
debug: {
// Exit the ongoing test suite if a test fails
failFast: true,
Expand Down
9 changes: 9 additions & 0 deletions tests/suites/os/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,15 @@ module.exports = {
console.log("No migration requested")
}


if(this.suite.options.artifacts !== undefined){
// extra artifacts "artifacts" are defined in the config.js of the suite
// these artifacts must be in the "suites" directory in the config.js - so you must copy them into suites before
// running the tests if these are build time artifacts
console.log(`Sending extra artifact folder: ${this.suite.options.artifacts} to worker...`)
await this.worker.sendFile(`${__dirname}/${this.suite.options.artifacts}`,'/data/', 'worker');
}

if ( this.os.configJson.installer.secureboot ) {
console.log("Opting-in secure boot and full disk encryption")
} else {
Expand Down

0 comments on commit 92a14f7

Please sign in to comment.