Skip to content

Commit

Permalink
BUGFIX: Start Chronyd on frontend
Browse files Browse the repository at this point in the history
INTERNAL: Fix test cases for time services

TODO: Test cases for Backend NTP/Chorny services

STACKI-982 #Done
  • Loading branch information
anooprajendra committed May 1, 2019
1 parent 87122de commit 06dcbc7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions common/nodes/time-server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ https://github.com/Teradata/stacki/blob/master/LICENSE.txt
<stack:package>chrony</stack:package>

<stack:script stack:stage="install-post">
stack set attr attr=time.protocol value=chrony
stack report host time &hostname; | stack report script | sh
/opt/stack/bin/stack set attr attr=time.protocol value=chrony
/opt/stack/bin/stack set appliance attr frontend attr=time.protocol value=chrony
/opt/stack/bin/stack report host time &hostname; | /opt/stack/bin/stack report script | sh
</stack:script>
</stack:stack>

Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ def run(self, params, args):
protocol = 'ntp'

self.timeservers = self.getNTPServers(host)
if len(self.timeservers) == 0:
raise CommandError(self, f'No time servers specified for host {host}. Check network interface assignments')

self.runImplementation('time_%s' % protocol, (host))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'smq-producer',
'smq-publisher',
'sshd',
'chronyd',
]

SKIP_SVCS = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,10 @@ def _inner(name, address):
# to get more networks added

return _inner

@pytest.fixture
def add_host_with_net(host):
host.run("stack add network test pxe=true address=192.168.0.0 mask=255.255.255.0")
host.run("stack add host interface a:frontend interface=eth2 network=test ip=192.168.0.2")
host.run("stack add host backend-0-0 appliance=backend rack=0 rank=0")
host.run("stack add host interface backend-0-0 interface=eth0 network=test ip=192.168.0.3")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import xml.etree.ElementTree as ET


def test_list_host_profile(host, add_host, revert_export_stack_carts):
def test_list_host_profile(host, add_host_with_net, revert_export_stack_carts):
result = host.run('stack list host profile backend-0-0')
assert result.rc == 0

Expand Down

0 comments on commit 06dcbc7

Please sign in to comment.