Skip to content

Commit 1814caa

Browse files
committed
Add network tests for illumos
1 parent de45e72 commit 1814caa

9 files changed

Lines changed: 63 additions & 2 deletions

File tree

cloudinit/distros/illumos.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def manage_service(self, action, service):
5858
cmd = ['svcs', '-H', '-o', 'state', service]
5959
try:
6060
(out, err) = subp.subp(cmd, capture=True)
61-
except ProcessExecutionError:
61+
except subp.ProcessExecutionError:
6262
# Pass back to caller
6363
raise
6464

@@ -71,7 +71,7 @@ def manage_service(self, action, service):
7171
# Callers do not actually check the exit status unless
7272
# distro.uses_systemd() is True but exit code 3 would mean
7373
# 'not running', so we use that.
74-
raise ProcessExecutionError(
74+
raise subp.ProcessExecutionError(
7575
cmd=cmd, stdout=out, stderr=err, exit_code=3
7676
)
7777

@@ -285,5 +285,8 @@ def apply_locale(self, locale, out_fn=None):
285285
def set_timezone(self, tz):
286286
self._update_init('TZ', tz)
287287

288+
def chpasswd(self, plist_in: list, hashed: bool):
289+
for name, password in plist_in:
290+
self.set_passwd(name, password, hashed=hashed)
288291

289292
# vim:ts=4:sw=4:et:fdm=marker

test/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
zadm set citest cloud-init=http://172.27.10.254/cloudinit/
3+

test/cloud-init/meta-data

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
instance-id: 40d84db8-bf08-48b9-c347-fb436d131bb1
2+
local-hostname: test

test/cloud-init/meta-data~

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
instance-id: 40d84db8-bf08-48b9-c347-fb436d131bb1
2+
local-hostname: test

test/cloud-init/network-config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ethernets:
2+
bob3:
3+
addresses:
4+
- 10.0.0.5/25
5+
gateway4: 10.0.0.127
6+
match:
7+
macaddress: 02:08:20:7c:68:7a
8+
nameservers:
9+
addresses:
10+
- 1.1.1.1
11+
- 9.9.9.9
12+
search: omnios.org
13+
set-name: bob3
14+
version: 2

test/cloud-init/user-data

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#cloud-config
2+
chpasswd:
3+
expire: false
4+
disable_root: false
5+
hostname: test
6+
password: $6$SEeDRaFR$CI8Y/wfMXioIWlrtTLs75iOA4m/./1Vu78d5Plhk6N/T.yctR/s8ojMIjIhyIJB8lwYJAlQXi5GBuh4O0gjY5/
7+
ssh-pwauth: true
8+
ssh_authorized_keys:
9+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKi3Xy6qla2g7wH5b1t+6nDi99D/Unl9Hqpi7j4acP8s
10+
cinit
11+
users:
12+
- default
13+
- name: root
14+
ssh_authorized_keys:
15+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKi3Xy6qla2g7wH5b1t+6nDi99D/Unl9Hqpi7j4acP8s
16+
cinit
17+
packages:
18+
- system/cpuid
19+
- [system/pciutils, 3.7.0]
20+
package_reboot_if_required: false

test/cloud-init/user-data~

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#cloud-config
2+
chpasswd:
3+
expire: false
4+
disable_root: false
5+
hostname: test
6+
password: $6$SEeDRaFR$CI8Y/wfMXioIWlrtTLs75iOA4m/./1Vu78d5Plhk6N/T.yctR/s8ojMIjIhyIJB8lwYJAlQXi5GBuh4O0gjY5/
7+
ssh-pwauth: true
8+
ssh_authorized_keys:
9+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKi3Xy6qla2g7wH5b1t+6nDi99D/Unl9Hqpi7j4acP8s
10+
cinit
11+
users:
12+
- default
13+
- name: root
14+
ssh_authorized_keys:
15+
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKi3Xy6qla2g7wH5b1t+6nDi99D/Unl9Hqpi7j4acP8s
16+
cinit

test/cloud-init/vendor-data

Whitespace-only changes.

test/cloudinit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cloud-init

0 commit comments

Comments
 (0)