Merge pull request from balena-io/os-configure-tests

Add more realistic os configure tests
This commit is contained in:
flowzone-app[bot] 2024-12-30 17:15:09 +00:00 committed by GitHub
commit 56ab785a82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 215 additions and 114 deletions

199
npm-shrinkwrap.json generated

@ -2407,13 +2407,14 @@
}
},
"node_modules/@inquirer/checkbox/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -2427,10 +2428,11 @@
}
},
"node_modules/@inquirer/checkbox/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -2661,13 +2663,14 @@
}
},
"node_modules/@inquirer/editor/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -2681,10 +2684,11 @@
}
},
"node_modules/@inquirer/editor/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -2807,13 +2811,14 @@
}
},
"node_modules/@inquirer/expand/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -2827,10 +2832,11 @@
}
},
"node_modules/@inquirer/expand/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -2910,10 +2916,11 @@
}
},
"node_modules/@inquirer/figures": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz",
"integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.9.tgz",
"integrity": "sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
}
@ -2948,13 +2955,14 @@
}
},
"node_modules/@inquirer/number/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -2968,10 +2976,11 @@
}
},
"node_modules/@inquirer/number/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -3068,13 +3077,14 @@
}
},
"node_modules/@inquirer/password/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -3088,10 +3098,11 @@
}
},
"node_modules/@inquirer/password/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -3195,13 +3206,14 @@
}
},
"node_modules/@inquirer/prompts/node_modules/@inquirer/confirm": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.0.tgz",
"integrity": "sha512-osaBbIMEqVFjTX5exoqPXs6PilWQdjaLhGtMDXMXg/yxkHXNq43GlxGyTA35lK2HpzUgDN+Cjh/2AmqCN0QJpw==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.1.tgz",
"integrity": "sha512-vVLSbGci+IKQvDOtzpPTCOiEJCNidHcAq9JYVoWTW0svb5FiwSLotkM+JXNXejfjnzVYV9n0DTBythl9+XgTxg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/core": "^10.1.1",
"@inquirer/type": "^3.0.1"
"@inquirer/core": "^10.1.2",
"@inquirer/type": "^3.0.2"
},
"engines": {
"node": ">=18"
@ -3211,13 +3223,14 @@
}
},
"node_modules/@inquirer/prompts/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -3231,13 +3244,14 @@
}
},
"node_modules/@inquirer/prompts/node_modules/@inquirer/input": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.1.0.tgz",
"integrity": "sha512-16B8A9hY741yGXzd8UJ9R8su/fuuyO2e+idd7oVLYjP23wKJ6ILRIIHcnXe8/6AoYgwRS2zp4PNsW/u/iZ24yg==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.1.1.tgz",
"integrity": "sha512-nAXAHQndZcXB+7CyjIW3XuQZZHbQQ0q8LX6miY6bqAWwDzNa9JUioDBYrFmOUNIsuF08o1WT/m2gbBXvBhYVxg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/core": "^10.1.1",
"@inquirer/type": "^3.0.1"
"@inquirer/core": "^10.1.2",
"@inquirer/type": "^3.0.2"
},
"engines": {
"node": ">=18"
@ -3247,14 +3261,15 @@
}
},
"node_modules/@inquirer/prompts/node_modules/@inquirer/select": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.3.tgz",
"integrity": "sha512-OZfKDtDE8+J54JYAFTUGZwvKNfC7W/gFCjDkcsO7HnTH/wljsZo9y/FJquOxMy++DY0+9l9o/MOZ8s5s1j5wmw==",
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.4.tgz",
"integrity": "sha512-ZzYLuLoUzTIW9EJm++jBpRiTshGqS3Q1o5qOEQqgzaBlmdsjQr6pA4TUNkwu6OBYgM2mIRbCz6mUhFDfl/GF+w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/core": "^10.1.1",
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/core": "^10.1.2",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"yoctocolors-cjs": "^2.1.2"
},
@ -3266,10 +3281,11 @@
}
},
"node_modules/@inquirer/prompts/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -3282,6 +3298,7 @@
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
"integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"type-fest": "^0.21.3"
},
@ -3297,6 +3314,7 @@
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz",
"integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">= 12"
}
@ -3306,6 +3324,7 @@
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz",
"integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",
"dev": true,
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
@ -3315,6 +3334,7 @@
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
},
@ -3327,6 +3347,7 @@
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
"dev": true,
"license": "(MIT OR CC0-1.0)",
"engines": {
"node": ">=10"
},
@ -3339,6 +3360,7 @@
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
@ -3366,13 +3388,14 @@
}
},
"node_modules/@inquirer/rawlist/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -3386,10 +3409,11 @@
}
},
"node_modules/@inquirer/rawlist/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -3487,13 +3511,14 @@
}
},
"node_modules/@inquirer/search/node_modules/@inquirer/core": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
"version": "10.1.2",
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz",
"integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@inquirer/figures": "^1.0.8",
"@inquirer/type": "^3.0.1",
"@inquirer/figures": "^1.0.9",
"@inquirer/type": "^3.0.2",
"ansi-escapes": "^4.3.2",
"cli-width": "^4.1.0",
"mute-stream": "^2.0.0",
@ -3507,10 +3532,11 @@
}
},
"node_modules/@inquirer/search/node_modules/@inquirer/type": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz",
"integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
@ -12639,10 +12665,11 @@
}
},
"node_modules/is-core-module": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.0.tgz",
"integrity": "sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g==",
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
"integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
"dev": true,
"license": "MIT",
"dependencies": {
"hasown": "^2.0.2"
},

@ -21,6 +21,7 @@ import * as process from 'process';
import { runCommand } from '../../helpers';
import { promisify } from 'util';
import * as tmp from 'tmp';
import type * as $imagefs from 'balena-image-fs';
tmp.setGracefulCleanup();
const tmpNameAsync = promisify(tmp.tmpName);
@ -29,30 +30,51 @@ import { BalenaAPIMock } from '../../nock/balena-api-mock';
if (process.platform !== 'win32') {
describe('balena os configure', function () {
let imagefs: typeof $imagefs;
let api: BalenaAPIMock;
let tmpPath: string;
let tmpDummyPath: string;
let tmpMatchingDtJsonPartitionPath: string;
beforeEach(async () => {
before(async function () {
// We conditionally import balena-image-fs, since when imported on top level then unrelated tests on win32 failed with:
// EPERM: operation not permitted, rename 'C:\Users\RUNNER~1\AppData\Local\Temp\tmp-<...>.inprogress' -> 'C:\Users\RUNNER~1\AppData\Local\Temp\tmp-<...>'
// at async Object.rename (node:internal/fs/promises:782:10) {
imagefs = await import('balena-image-fs');
tmpDummyPath = (await tmpNameAsync()) as string;
await fs.copyFile('./tests/test-data/dummy.img', tmpDummyPath);
tmpMatchingDtJsonPartitionPath = (await tmpNameAsync()) as string;
await fs.copyFile(
'./tests/test-data/mock-jetson-nano-6.0.13.with-boot-partition-12.img',
tmpMatchingDtJsonPartitionPath,
);
});
beforeEach(() => {
api = new BalenaAPIMock();
api.expectGetWhoAmI({ optional: true, persist: true });
tmpPath = (await tmpNameAsync()) as string;
await fs.copyFile('./tests/test-data/dummy.img', tmpPath);
});
afterEach(async () => {
afterEach(() => {
api.done();
await fs.unlink(tmpPath);
});
it('should inject a valid config.json file', async () => {
after(async () => {
await fs.unlink(tmpDummyPath);
await fs.unlink(tmpMatchingDtJsonPartitionPath);
});
it('should inject a valid config.json file to an image with partition 12 as boot & matching device-type.json ', async () => {
api.expectGetApplication();
api.expectGetDeviceTypes();
// TODO: this shouldn't be necessary & the CLI should be able to find
// everything required from the device-type.json in the image.
api.expectGetConfigDeviceTypes();
api.expectDownloadConfig();
const command: string[] = [
`os configure ${tmpPath}`,
'--device-type raspberrypi3',
'--version 2.47.0+rev1',
`os configure ${tmpMatchingDtJsonPartitionPath}`,
'--device-type jetson-nano',
'--version 6.0.13',
'--fleet testApp',
'--config-app-update-poll-interval 10',
'--config-network ethernet',
@ -65,8 +87,57 @@ if (process.platform !== 'win32') {
expect(err.join('')).to.equal('');
// confirm the image contains a config.json...
const imagefs = await import('balena-image-fs');
const config = await imagefs.interact(tmpPath, 1, async (_fs) => {
const config = await imagefs.interact(
tmpMatchingDtJsonPartitionPath,
12,
async (_fs) => {
const readFileAsync = promisify(_fs.readFile);
const dtJson = JSON.parse(
await readFileAsync('/device-type.json', { encoding: 'utf8' }),
);
// confirm that the device-type.json mentions the expected partition
expect(dtJson).to.have.nested.property(
'configuration.config.partition',
12,
);
return await readFileAsync('/config.json');
},
);
expect(config).to.not.be.empty;
// confirm the image has the correct config.json values...
const configObj = JSON.parse(config.toString('utf8'));
expect(configObj).to.have.property('deviceType', 'jetson-nano');
expect(configObj).to.have.property('initialDeviceName', 'testDeviceName');
});
// TODO: In the next major consider just failing when we can't find a device-types.json in the image.
it('should inject a valid config.json file to a dummy image', async () => {
api.expectGetApplication();
// Since the dummy image doesn't include a device-type.json
// we have to reach to the API to fetch the manifest of the device type.
api.expectGetConfigDeviceTypes();
api.expectDownloadConfig();
const command: string[] = [
`os configure ${tmpDummyPath}`,
'--device-type raspberrypi3',
'--version 2.47.0+rev1',
'--fleet testApp',
'--config-app-update-poll-interval 10',
'--config-network ethernet',
'--initial-device-name testDeviceName',
'--provisioning-key-name testKey',
'--provisioning-key-expiry-date 2050-12-12',
];
const { err } = await runCommand(command.join(' '));
// Once we replace the dummy.img with one that includes a os-release & device-type.json
// then we should be able to change this to expect no errors.
expect(err.join('')).to.equal('');
// confirm the image contains a config.json...
const config = await imagefs.interact(tmpDummyPath, 1, async (_fs) => {
return await promisify(_fs.readFile)('/config.json');
});
expect(config).to.not.be.empty;

@ -61,22 +61,25 @@ export class BalenaAPIMock extends NockMock {
}
public expectDownloadConfig(opts: ScopeOpts = {}) {
this.optPost('/download-config', opts).reply(
200,
JSON.parse(`{
"applicationId":1301645,
"deviceType":"raspberrypi3",
"userId":43699,
"appUpdatePollInterval":600000,
"listenPort":48484,
"vpnPort":443,
"apiEndpoint":"https://api.balena-cloud.com",
"vpnEndpoint":"vpn.balena-cloud.com",
"registryEndpoint":"registry2.balena-cloud.com",
"deltaEndpoint":"https://delta.balena-cloud.com",
"apiKey":"nothingtoseehere"
}`),
);
this.optPost('/download-config', opts).reply(200, (_uri, body) => {
let deviceType = 'raspberrypi3';
if (typeof body === 'object' && 'deviceType' in body) {
deviceType = body.deviceType;
}
return JSON.parse(`{
"applicationId":1301645,
"deviceType":"${deviceType}",
"userId":43699,
"appUpdatePollInterval":600000,
"listenPort":48484,
"vpnPort":443,
"apiEndpoint":"https://api.balena-cloud.com",
"vpnEndpoint":"vpn.balena-cloud.com",
"registryEndpoint":"registry2.balena-cloud.com",
"deltaEndpoint":"https://delta.balena-cloud.com",
"apiKey":"nothingtoseehere"
}`);
});
}
public expectApplicationProvisioning(opts: ScopeOpts = {}) {