Skip to content

Commit 06dcbc7

Browse files
committed
BUGFIX: Start Chronyd on frontend
INTERNAL: Fix test cases for time services TODO: Test cases for Backend NTP/Chorny services STACKI-982 #Done
1 parent 87122de commit 06dcbc7

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

common/nodes/time-server.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ https://github.com/Teradata/stacki/blob/master/LICENSE.txt
1010
<stack:package>chrony</stack:package>
1111

1212
<stack:script stack:stage="install-post">
13-
stack set attr attr=time.protocol value=chrony
14-
stack report host time &hostname; | stack report script | sh
13+
/opt/stack/bin/stack set attr attr=time.protocol value=chrony
14+
/opt/stack/bin/stack set appliance attr frontend attr=time.protocol value=chrony
15+
/opt/stack/bin/stack report host time &hostname; | /opt/stack/bin/stack report script | sh
1516
</stack:script>
1617
</stack:stack>
1718

common/src/stack/command/stack/commands/report/host/time/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ def run(self, params, args):
167167
protocol = 'ntp'
168168

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

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

common/src/stack/report-system/command/report/system/tests/test_services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'smq-producer',
1111
'smq-publisher',
1212
'sshd',
13+
'chronyd',
1314
]
1415

1516
SKIP_SVCS = {}

test-framework/test-suites/integration/tests/fixtures/add_data.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,10 @@ def _inner(name, address):
188188
# to get more networks added
189189

190190
return _inner
191+
192+
@pytest.fixture
193+
def add_host_with_net(host):
194+
host.run("stack add network test pxe=true address=192.168.0.0 mask=255.255.255.0")
195+
host.run("stack add host interface a:frontend interface=eth2 network=test ip=192.168.0.2")
196+
host.run("stack add host backend-0-0 appliance=backend rack=0 rank=0")
197+
host.run("stack add host interface backend-0-0 interface=eth0 network=test ip=192.168.0.3")

test-framework/test-suites/integration/tests/list/test_list_host_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import xml.etree.ElementTree as ET
22

33

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

0 commit comments

Comments
 (0)