Commit Graph

4316 Commits

Author SHA1 Message Date
Pagan Gazzard
d587a323f2 Fix locking stubs that were returning Bluebird rather than Promise
Change-type: patch
2022-11-11 16:52:19 +00:00
Balena CI
ae756cfabe
v14.3.1 2022-11-11 16:47:26 +00:00
bulldozer-balena[bot]
ca02818e8d
Merge pull request #2058 from balena-os/update-blinking
Update blinking to 0.0.7
2022-11-11 16:46:07 +00:00
Pagan Gazzard
9e154da76e Update blinking to 0.0.7
Update blinking from 0.0.5 to 0.0.7

Change-type: patch
2022-11-11 16:06:11 +00:00
Balena CI
d766e3d103
v14.3.0 2022-11-10 01:09:40 +00:00
bulldozer-balena[bot]
224eeb86a0
Merge pull request #2054 from balena-os/improve-sv-docker-network-setup
Convert ensureSupervisorNetwork to native Promises, remove sys interface check
2022-11-10 01:08:12 +00:00
Christina Ying Wang
af0bb87def Improve error message if supervisor0 network not found
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-09 10:22:27 -08:00
Christina Ying Wang
1034aa70e6 Convert ensureSupervisorNetwork to native Promises
Also remove system interface check from ensureSupervisorNetwork.

Previously `ensure` was a Bluebird promise which wasn't awaited in
its composition step. This has been here for some time and may contribute
to issues with duplicate networks. The conversion to native Promises
allows `ensure` to be awaited, hopefully reducing instances of duplicate
networks.

Removing the system interface check for /sys/class/net/supervisor0
because it's superfluous given that the Engine creates the interface
with NetworkManager. It also makes testing a lot more difficult to set up
as /sys/class/net isn't a directory that can be written to for emulating
system interface creation / removal.

Relates-to: https://github.com/balena-os/balena-supervisor/issues/1110
Change-type: minor
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-08 16:06:10 -08:00
Christina Ying Wang
57f4dcbcac Change macAddressPath to /sys/class/net
Previously it was set at /mnt/root/sys/class/net, which is
the same as /sys/class/net because Supervisor has a network
mode of `host`.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-08 15:51:14 -08:00
Christina Ying Wang
75bf2aa3b4 Improve NotFoundError handling
Use isNotFoundError which converts an error of the default type
`unknown` into NotFoundError if the error is an instance of NotFoundError.
Thrown errors are of type `unknown` by default so we should use methods
with type guards for better type narrowing.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-08 15:41:52 -08:00
Balena CI
80e213ab7e
v14.2.21 2022-11-07 21:20:00 +00:00
bulldozer-balena[bot]
fbdd43d00a
Merge pull request #2053 from balena-os/fix-unmanaged-target-state-behavior
Allow local target state to be applied in unmanaged mode
2022-11-07 21:18:37 +00:00
Christina Ying Wang
fd320f85b5 Allow local target state to be applied in unmanaged mode
An unmanaged Supervisor will not have a balenaApi defined, so any
attempts to POST /v2/local/target-state will cause the Supervisor to
crash loop. This fix allows for the Supervisor to apply local target
state, which is useful for integration testing.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-07 12:25:41 -08:00
Christina Ying Wang
fc15ad2554 Fix typo: intialise -> initialize
Missing "i"

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-07 12:09:17 -08:00
Balena CI
f5ec74211f
v14.2.20 2022-11-03 22:27:41 +00:00
bulldozer-balena[bot]
d1825a18e2
Merge pull request #2050 from balena-os/vipul/update-locks
patch: Update locks behavior for config changes
2022-11-03 22:26:18 +00:00
Balena CI
c4b2cb867e
v14.2.19 2022-11-03 21:20:53 +00:00
bulldozer-balena[bot]
ff7f43c7f2
Merge pull request #2052 from balena-os/run-sv-in-container
Run the built supervisor as part of docker-compose tests
2022-11-03 21:17:21 +00:00
Felipe Lalanne
46fa7321c0 Run the built supervisor as part of docker-compose tests
This allows to test that the supervisor build actually runs and opens up the
possibility of running more exhaustive API tests against a working supervisor.

Change-type: patch
2022-11-03 15:45:39 -03:00
Felipe Lalanne
460c3ba0aa Remove DOCKER_ROOT assignments from entry.sh
These variables are not used anywhere and they don't seem to serve any
purpose. Cleaning these assingments as dead code
2022-11-03 10:33:51 -03:00
Balena CI
0bb3f0ad1f
v14.2.18 2022-11-02 19:00:54 +00:00
bulldozer-balena[bot]
9549491922
Merge pull request #2051 from balena-os/update-before-dbus-install
Update apt repositories before installing dbus
2022-11-02 18:59:24 +00:00
Christina Ying Wang
574f2ffb14 Update apt repositories before installing dbus
GitHub actions are erroring due to the package not being found;
Updating the repository listings shoud fix this.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-11-02 11:19:52 -07:00
Vipul Gupta (@vipulgupta2048)
63bd9605cf patch: Update locks behavior for config changes
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipul@balena.io>
2022-11-02 11:50:31 +00:00
Balena CI
9e2d912fa1
v14.2.17 2022-11-01 21:47:55 +00:00
bulldozer-balena[bot]
849eee6cea
Merge pull request #2044 from balena-os/migrate-core-api-tests
Migrate core API tests to unit/integration excluding v1/v2 routes
2022-11-01 21:46:22 +00:00
Balena CI
636d623151
v14.2.16 2022-10-27 15:00:47 +00:00
bulldozer-balena[bot]
2d01123112
Merge pull request #2045 from balena-os/add_agx_orin_to_supported_fdt
config/backends: Add Jetson AGX Orin Devkit to the list of DTs that support configurable device-trees
2022-10-27 14:59:18 +00:00
Alexandru Costache
ea92fa9162 config/backends: Add Jetson AGX Orin Devkit to the list of DTs that support configurable device-tree
Change-type: patch
Signed-off-by: Alexandru Costache <alexandru@balena.io>
2022-10-26 12:35:01 +03:00
Christina Ying Wang
532e75a77e Migrate API tests to unit/integration
This excludes route tests or refactoring. Also, created tests
for API middleware.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-25 19:06:39 +00:00
Balena CI
fd285b8f25
v14.2.15 2022-10-20 14:43:06 +00:00
bulldozer-balena[bot]
156aac4b02
Merge pull request #2040 from balena-os/docker-utils
Migrate some more legacy tests to integration
2022-10-20 14:41:11 +00:00
pipex
117651ab3c Update sinon 2022-10-19 20:38:34 -03:00
pipex
0befb30018 Migrate firewall tests to integration 2022-10-19 14:09:45 -03:00
pipex
fdbd4e32e3 Migrate db-format tests to integration 2022-10-19 12:07:03 -03:00
pipex
aa3002f909 Migrate docker-util tests
Merged docker-utils and delta tests into a single test suite. They are
now ran as part of the integration tests using the real engine.

Change-type: patch
2022-10-19 12:05:52 -03:00
Balena CI
93ca9c05f3
v14.2.14 2022-10-19 13:35:19 +00:00
bulldozer-balena[bot]
0a423811a0
Merge pull request #2038 from balena-os/legacy-unit-tests
Migrate simple legacy tests to test/unit and test/integration
2022-10-19 13:34:07 +00:00
pipex
620bcae53a Migrate simple legacy tests to test/unit and test/integration
Change-type: patch
2022-10-18 20:36:53 -03:00
Balena CI
1185b92bb4
v14.2.13 2022-10-18 22:58:19 +00:00
bulldozer-balena[bot]
ccb04d42ce
Merge pull request #1842 from balena-os/api-code-reorganization
Move all Supervisor API related routes & code to device-api directory
2022-10-18 22:57:02 +00:00
Christina Ying Wang
463d73f8a4 Access api-key methods through device API
This makes for better black boxing of device API as a module.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
f586b7c9a8 Make dbus module side-effect free to not interfere with unit tests
When code that is unit tested is part of a file that imports modules which
depend on the dbus module, this breaks the unit test environment because there
is no system socket set up, as the unit test mocha config doesn't import fixtures.ts.

For example, if we change src/compose/utils to import device-config or api-binder, both
of those modules import lib/dbus which invokes a dbus.getBus call at the root level. This
is problematic for unit testing.

We can get around the root-level dbus.getBus call by initializing dbus only when it's first
needed. The mocked-dbus test setup code can also be removed in favor of legacy mocha
hooks, which makes the dbus stubbing in the legacy test environment more clear.
We can remove these legacy hooks when all the legacy tests are migrated to unit/integration.

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
966d957465 Convert common.js to TypeScript
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:27:19 -07:00
Christina Ying Wang
f77fcb9ac9 Move messages.ts to device-api
Messages are all related to Supervisor API

Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
71b2aea0fe Use v2 router directly instead of through application manager
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
ce5bf89dfc Move /v1 routes in deviceState.router to v1.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
a2d9af2407 Move /v1 routes in apiBinder.router to v1.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
d08f25f0a3 Consolidate API middlewares, move api-keys to device-api
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00
Christina Ying Wang
5af146ec4e Move supervisor-api.ts to device-api/index.ts
Signed-off-by: Christina Ying Wang <christina@balena.io>
2022-10-18 14:16:53 -07:00