add systemd after list
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b3a53b0f6c
commit
ed046b9566
@ -10,6 +10,9 @@ homeassistant_extra_groups:
|
||||
- tty
|
||||
- dialout
|
||||
|
||||
homeassistant_systemd_after:
|
||||
- network-online.target
|
||||
|
||||
homeassistant_base_dir: /opt/homeassistant
|
||||
homeassistant_conf_dir: "{{ homeassistant_base_dir }}/config"
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
import warnings
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_hassio_running_and_enabled(host):
|
||||
hassio = host.service("homeassistant")
|
||||
assert hassio.is_running
|
||||
assert hassio.is_enabled
|
||||
|
||||
|
||||
def test_hassio_socket(host):
|
||||
# Verify the socket is listening for HTTP traffic
|
||||
for _ in range(30):
|
||||
if host.socket("tcp://0.0.0.0:8123").is_listening:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
assert host.socket("tcp://0.0.0.0:8123").is_listening
|
@ -1,14 +1,26 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
import warnings
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_hosts_file(host):
|
||||
f = host.file('/etc/hosts')
|
||||
def test_hassio_running_and_enabled(host):
|
||||
hassio = host.service("homeassistant")
|
||||
assert hassio.is_running
|
||||
assert hassio.is_enabled
|
||||
|
||||
assert f.exists
|
||||
assert f.user == 'root'
|
||||
assert f.group == 'root'
|
||||
|
||||
def test_hassio_socket(host):
|
||||
# Verify the socket is listening for HTTP traffic
|
||||
for _ in range(30):
|
||||
if host.socket("tcp://0.0.0.0:8123").is_listening:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
assert host.socket("tcp://0.0.0.0:8123").is_listening
|
||||
|
@ -3,7 +3,9 @@
|
||||
[Unit]
|
||||
Description=Home Assistant
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
{% for item in homeassistant_systemd_after %}
|
||||
After={{ item }}
|
||||
{% endfor %}
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
Loading…
Reference in New Issue
Block a user