add systemd after list
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Robert Kaussow 2019-10-13 23:15:36 +02:00
parent b3a53b0f6c
commit ed046b9566
4 changed files with 23 additions and 32 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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