2022-08-22 23:54:21 +00:00
|
|
|
version: '2.3'
|
|
|
|
|
|
|
|
services:
|
|
|
|
# Override the supervisor service configuration. The tests will
|
|
|
|
# be run through the `sut` service
|
|
|
|
balena-supervisor:
|
|
|
|
build:
|
2022-09-12 22:14:37 +00:00
|
|
|
dockerfile: Dockerfile
|
2022-08-22 23:54:21 +00:00
|
|
|
context: ./
|
|
|
|
command: sleep infinity
|
|
|
|
|
2022-08-25 17:12:53 +00:00
|
|
|
dbus:
|
2022-09-29 20:52:29 +00:00
|
|
|
image: balenablocks/dbus
|
|
|
|
environment:
|
|
|
|
DBUS_CONFIG: session.conf
|
|
|
|
DBUS_ADDRESS: unix:path=/run/dbus/system_bus_socket
|
|
|
|
volumes:
|
|
|
|
- dbus:/run/dbus
|
|
|
|
|
|
|
|
# Fake system service to listen for supervisor
|
|
|
|
# requests
|
|
|
|
dbus-services:
|
|
|
|
build: ./test/lib/dbus
|
|
|
|
depends_on:
|
|
|
|
- dbus
|
|
|
|
volumes:
|
|
|
|
- dbus:/run/dbus
|
|
|
|
environment:
|
|
|
|
DBUS_SYSTEM_BUS_ADDRESS: unix:path=/run/dbus/system_bus_socket
|
2022-08-25 17:12:53 +00:00
|
|
|
|
2022-08-22 23:54:21 +00:00
|
|
|
docker:
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
environment:
|
|
|
|
DOCKER_TLS_CERTDIR: ''
|
|
|
|
command: --tls=false --debug
|
|
|
|
|
|
|
|
sut:
|
|
|
|
# Build the supervisor code for development and testing
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: Dockerfile.template
|
|
|
|
target: test
|
|
|
|
args:
|
|
|
|
# Change this if testing in another architecture
|
2022-09-29 20:52:29 +00:00
|
|
|
ARCH: ${ARCH:-amd64}
|
2022-08-22 23:54:21 +00:00
|
|
|
depends_on:
|
|
|
|
- balena-supervisor
|
|
|
|
- docker
|
2022-08-25 17:12:53 +00:00
|
|
|
- dbus
|
2022-09-29 20:52:29 +00:00
|
|
|
- dbus-services
|
|
|
|
volumes:
|
|
|
|
- dbus:/run/dbus
|
2022-08-22 23:54:21 +00:00
|
|
|
# Set required supervisor configuration variables here
|
|
|
|
environment:
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
2022-09-29 20:52:29 +00:00
|
|
|
DBUS_SYSTEM_BUS_ADDRESS: unix:path=/run/dbus/system_bus_socket
|
2022-08-24 20:02:19 +00:00
|
|
|
# Required by migrations
|
2022-08-25 17:12:53 +00:00
|
|
|
CONFIG_MOUNT_POINT: /mnt/root/mnt/boot/config.json
|
|
|
|
# Read by constants to setup `bootMountpoint`
|
|
|
|
BOOT_MOUNTPOINT: /mnt/boot
|
2022-08-22 23:54:21 +00:00
|
|
|
# Set required mounts as tmpfs or volumes here
|
|
|
|
# if specific files need to be backed up between tests,
|
|
|
|
# make sure to add them to the `testfs` configuration under
|
|
|
|
# .mochapodrc.yml
|
|
|
|
tmpfs:
|
|
|
|
- /data
|
2022-08-24 20:02:19 +00:00
|
|
|
- /mnt/root
|
2022-09-29 20:52:29 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
dbus:
|
|
|
|
driver_opts:
|
|
|
|
# Use tmpfs to avoid files remaining between runs
|
|
|
|
type: tmpfs
|
|
|
|
device: tmpfs
|