Use default demo credentials (#320)
This commit is contained in:
18
Makefile
18
Makefile
@@ -1,8 +1,3 @@
|
||||
export UNIFI_VERSION ?= latest
|
||||
export UNIFI_USERNAME ?= tfacctest
|
||||
export UNIFI_EMAIL ?= tfacctest@example.com
|
||||
export UNIFI_PASSWORD ?= tfacctest1234
|
||||
|
||||
TEST ?= ./...
|
||||
TESTARGS ?=
|
||||
TEST_COUNT ?= 1
|
||||
@@ -16,19 +11,12 @@ build:
|
||||
|
||||
.PHONY: testacc
|
||||
testacc:
|
||||
TF_ACC=1 UNIFI_ACC_WLAN_CONCURRENCY=3 UNIFI_API=https://localhost:8443 UNIFI_INSECURE=true go test $(TEST) -v -count=$(TEST_COUNT) $(TESTARGS)
|
||||
TF_ACC=1 UNIFI_ACC_WLAN_CONCURRENCY=3 UNIFI_API=https://localhost:8443 UNIFI_INSECURE=true UNIFI_USERNAME=admin UNIFI_PASSWORD=admin go test $(TEST) -v -count=$(TEST_COUNT) $(TESTARGS)
|
||||
|
||||
.PHONY: testacc-up
|
||||
testacc-up:
|
||||
docker-compose up --detach unifi
|
||||
|
||||
@echo -n "Waiting for container"
|
||||
@until test -n "$$(docker ps --filter id=$$(docker-compose ps --quiet unifi) --filter health=healthy --quiet)"; do echo -n .; sleep 1; done
|
||||
@echo
|
||||
|
||||
@echo "Bootstrapping Unifi controller"
|
||||
docker-compose up --abort-on-container-exit bootstrap
|
||||
docker compose up --detach --wait
|
||||
|
||||
.PHONY: testacc-down
|
||||
testacc-down:
|
||||
docker-compose down
|
||||
docker compose down
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
services:
|
||||
unifi:
|
||||
image: "jacobalberty/unifi:${UNIFI_VERSION:?}"
|
||||
image: "jacobalberty/unifi:${UNIFI_VERSION:-latest}"
|
||||
init: true
|
||||
restart: "always"
|
||||
user: "unifi"
|
||||
@@ -10,24 +10,3 @@ services:
|
||||
- "${UNIFI_HTTPS_PORT:-8443}:8443/tcp"
|
||||
volumes:
|
||||
- "./scripts/init.d:/usr/local/unifi/init.d:ro"
|
||||
|
||||
bootstrap:
|
||||
image: "alpine/httpie"
|
||||
depends_on:
|
||||
unifi:
|
||||
condition: "service_healthy"
|
||||
entrypoint: "/bin/sh"
|
||||
command:
|
||||
- "-c"
|
||||
- |
|
||||
alias http='http --quiet --check-status --verify=no --ignore-stdin'
|
||||
|
||||
http https://unifi:8443/manage/account/login 2>/dev/null
|
||||
case $$? in
|
||||
0) echo 'Unifi controller has already been setup' >&2; exit 0;;
|
||||
3) echo 'Bootstrapping Unifi controller';;
|
||||
*) echo 'Unexpected HTTP response from Unifi controller' >&2; exit 1;;
|
||||
esac
|
||||
|
||||
http https://unifi:8443/api/cmd/sitemgr cmd=add-default-admin "name=${UNIFI_USERNAME:?}" "email=${UNIFI_EMAIL:?}" "x_password=${UNIFI_PASSWORD:?}"
|
||||
http https://unifi:8443/api/cmd/system cmd=set-installed
|
||||
|
||||
@@ -4,7 +4,6 @@ write_config() {
|
||||
echo "${1}=${2}" >> /usr/lib/unifi/data/system.properties
|
||||
}
|
||||
|
||||
write_config demo.skip_wizard false
|
||||
write_config is_simulation true
|
||||
|
||||
# Increase the number of demo devices to allow more concurrent tests to be executed simultaneously.
|
||||
|
||||
Reference in New Issue
Block a user