add systemd after list
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
b3a53b0f6c
commit
ed046b9566
|
@ -10,6 +10,9 @@ homeassistant_extra_groups:
|
||||||
- tty
|
- tty
|
||||||
- dialout
|
- dialout
|
||||||
|
|
||||||
|
homeassistant_systemd_after:
|
||||||
|
- network-online.target
|
||||||
|
|
||||||
homeassistant_base_dir: /opt/homeassistant
|
homeassistant_base_dir: /opt/homeassistant
|
||||||
homeassistant_conf_dir: "{{ homeassistant_base_dir }}/config"
|
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 os
|
||||||
|
import time
|
||||||
|
|
||||||
import testinfra.utils.ansible_runner
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||||
|
|
||||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||||
|
|
||||||
|
|
||||||
def test_hosts_file(host):
|
def test_hassio_running_and_enabled(host):
|
||||||
f = host.file('/etc/hosts')
|
hassio = host.service("homeassistant")
|
||||||
|
assert hassio.is_running
|
||||||
|
assert hassio.is_enabled
|
||||||
|
|
||||||
assert f.exists
|
|
||||||
assert f.user == 'root'
|
def test_hassio_socket(host):
|
||||||
assert f.group == 'root'
|
# 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]
|
[Unit]
|
||||||
Description=Home Assistant
|
Description=Home Assistant
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network-online.target
|
{% for item in homeassistant_systemd_after %}
|
||||||
|
After={{ item }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
Loading…
Reference in New Issue