From fa5dab2b14b251872a41f50f575442f60d622356 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Sat, 20 Aug 2016 14:38:58 +0200 Subject: [PATCH] MT#22125 Migrate tests to yaml format and update goss on v0.2.3 Change-Id: I0886f96ac351968e1c41920c4b046212d4cd92ef (cherry picked from commit 7d88933c58d18d1b57d8192ae5c32ffc4e7f7506) --- ce/01_hostname-and-interfaces.json.tt2 | 42 ---- ce/01_hostname-and-interfaces.yaml.tt2 | 35 +++ ce/01_running-processes.json.tt2 | 97 ------- ce/01_running-processes.yaml.tt2 | 68 +++++ ce/02_disk-free.json.tt2 | 18 -- ce/02_disk-free.yaml.tt2 | 12 + ce/03_files_availability.json.tt2 | 52 ---- ce/03_files_availability.yaml.tt2 | 48 ++++ ce/03_no-cores.json.tt2 | 11 - ce/03_no-cores.yaml.tt2 | 6 + ..._ports.json.tt2 => 03_open_ports.yaml.tt2} | 20 +- ce/04_template_files.json.tt2 | 9 - ce/04_template_files.yaml.tt2 | 5 + ce/05_system_users.json.tt2 | 139 ---------- ce/05_system_users.yaml.tt2 | 123 +++++++++ ce/06_system_packages.json.tt2 | 13 - ce/06_system_packages.yaml.tt2 | 9 + ce/07_system_service.json.tt2 | 84 ------- ce/07_system_service.yaml.tt2 | 80 ++++++ ce/08_system_ports.json.tt2 | 17 -- ce/08_system_ports.yaml.tt2 | 13 + ce/09_system_dns.json.tt2 | 20 -- ce/09_system_dns.yaml.tt2 | 14 ++ ce/10_sites_ok.json.tt2 | 237 ------------------ ce/10_sites_ok.yaml.tt2 | 211 ++++++++++++++++ ce/99_dummy.json.tt2 | 14 -- ce/99_dummy.yaml.tt2 | 9 + ce/goss.json.tt2 | 18 -- ce/goss.yaml.tt2 | 15 ++ pro/01_hostname-and-interfaces.json.tt2 | 42 ---- pro/01_hostname-and-interfaces.yaml.tt2 | 35 +++ pro/01_running-processes.json.tt2 | 115 --------- pro/01_running-processes.yaml.tt2 | 107 ++++++++ pro/02_disk-free.json.tt2 | 1 - pro/02_disk-free.yaml.tt2 | 1 + pro/03_files_availability.json.tt2 | 52 ---- pro/03_files_availability.yaml.tt2 | 49 ++++ pro/03_no-cores.json.tt2 | 1 - pro/03_no-cores.yaml.tt2 | 1 + pro/03_open_ports.json.tt2 | 193 -------------- pro/03_open_ports.yaml.tt2 | 191 ++++++++++++++ pro/04_template_files.json.tt2 | 1 - pro/04_template_files.yaml.tt2 | 1 + pro/05_system_users.json.tt2 | 1 - pro/05_system_users.yaml.tt2 | 1 + pro/06_system_packages.json.tt2 | 13 - pro/06_system_packages.yaml.tt2 | 9 + pro/07_system_service.json.tt2 | 215 ---------------- pro/07_system_service.yaml.tt2 | 213 ++++++++++++++++ pro/08_system_ports.json.tt2 | 1 - pro/08_system_ports.yaml.tt2 | 1 + pro/09_system_dns.json.tt2 | 27 -- pro/09_system_dns.yaml.tt2 | 21 ++ pro/10_sites_ok.json.tt2 | 1 - pro/10_sites_ok.yaml.tt2 | 1 + pro/99_dummy.json.tt2 | 1 - pro/99_dummy.yaml.tt2 | 1 + pro/goss.json.tt2 | 1 - pro/goss.yaml.tt2 | 1 + testrunner | 4 +- 60 files changed, 1291 insertions(+), 1450 deletions(-) delete mode 100644 ce/01_hostname-and-interfaces.json.tt2 create mode 100644 ce/01_hostname-and-interfaces.yaml.tt2 delete mode 100644 ce/01_running-processes.json.tt2 create mode 100644 ce/01_running-processes.yaml.tt2 delete mode 100644 ce/02_disk-free.json.tt2 create mode 100644 ce/02_disk-free.yaml.tt2 delete mode 100644 ce/03_files_availability.json.tt2 create mode 100644 ce/03_files_availability.yaml.tt2 delete mode 100644 ce/03_no-cores.json.tt2 create mode 100644 ce/03_no-cores.yaml.tt2 rename ce/{03_open_ports.json.tt2 => 03_open_ports.yaml.tt2} (57%) delete mode 100644 ce/04_template_files.json.tt2 create mode 100644 ce/04_template_files.yaml.tt2 delete mode 100644 ce/05_system_users.json.tt2 create mode 100644 ce/05_system_users.yaml.tt2 delete mode 100644 ce/06_system_packages.json.tt2 create mode 100644 ce/06_system_packages.yaml.tt2 delete mode 100644 ce/07_system_service.json.tt2 create mode 100644 ce/07_system_service.yaml.tt2 delete mode 100644 ce/08_system_ports.json.tt2 create mode 100644 ce/08_system_ports.yaml.tt2 delete mode 100644 ce/09_system_dns.json.tt2 create mode 100644 ce/09_system_dns.yaml.tt2 delete mode 100644 ce/10_sites_ok.json.tt2 create mode 100644 ce/10_sites_ok.yaml.tt2 delete mode 100644 ce/99_dummy.json.tt2 create mode 100644 ce/99_dummy.yaml.tt2 delete mode 100644 ce/goss.json.tt2 create mode 100644 ce/goss.yaml.tt2 delete mode 100644 pro/01_hostname-and-interfaces.json.tt2 create mode 100644 pro/01_hostname-and-interfaces.yaml.tt2 delete mode 100644 pro/01_running-processes.json.tt2 create mode 100644 pro/01_running-processes.yaml.tt2 delete mode 120000 pro/02_disk-free.json.tt2 create mode 120000 pro/02_disk-free.yaml.tt2 delete mode 100644 pro/03_files_availability.json.tt2 create mode 100644 pro/03_files_availability.yaml.tt2 delete mode 120000 pro/03_no-cores.json.tt2 create mode 120000 pro/03_no-cores.yaml.tt2 delete mode 100644 pro/03_open_ports.json.tt2 create mode 100644 pro/03_open_ports.yaml.tt2 delete mode 120000 pro/04_template_files.json.tt2 create mode 120000 pro/04_template_files.yaml.tt2 delete mode 120000 pro/05_system_users.json.tt2 create mode 120000 pro/05_system_users.yaml.tt2 delete mode 100644 pro/06_system_packages.json.tt2 create mode 100644 pro/06_system_packages.yaml.tt2 delete mode 100644 pro/07_system_service.json.tt2 create mode 100644 pro/07_system_service.yaml.tt2 delete mode 120000 pro/08_system_ports.json.tt2 create mode 120000 pro/08_system_ports.yaml.tt2 delete mode 100644 pro/09_system_dns.json.tt2 create mode 100644 pro/09_system_dns.yaml.tt2 delete mode 120000 pro/10_sites_ok.json.tt2 create mode 120000 pro/10_sites_ok.yaml.tt2 delete mode 120000 pro/99_dummy.json.tt2 create mode 120000 pro/99_dummy.yaml.tt2 delete mode 120000 pro/goss.json.tt2 create mode 120000 pro/goss.yaml.tt2 diff --git a/ce/01_hostname-and-interfaces.json.tt2 b/ce/01_hostname-and-interfaces.json.tt2 deleted file mode 100644 index 055e5ef..0000000 --- a/ce/01_hostname-and-interfaces.json.tt2 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "command": { - "hostname": { - "exit-status": 0 - }, -[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] - "hostname": { - "exit-status": 0, - "stdout": [ - "spce" - ], - "stderr": [] - }, - "hostname --fqdn": { - "exit-status": 0, - "stdout": [ - "spce." - ], - "stderr": [] - }, - "hostname --short": { - "exit-status": 0, - "stdout": [ - "spce" - ], - "stderr": [] - }, -[% END -%] - "[ $(hostname --short). = $(hostname --fqdn) ]": { - "comment": "short hostname should be the same as fqdn (ignoring trailing dot)", - "exit-status": 0, - "stdout": [], - "stderr": [] - }, - "[ $(resolveip -s $(hostname --fqdn)) = $(resolveip -s $(hostname --short)) ]": { - "comment": "ip-s of short hostname and fqdn should be the same", - "exit-status": 0, - "stdout": [], - "stderr": [] - } - } -} diff --git a/ce/01_hostname-and-interfaces.yaml.tt2 b/ce/01_hostname-and-interfaces.yaml.tt2 new file mode 100644 index 0000000..6be3d7e --- /dev/null +++ b/ce/01_hostname-and-interfaces.yaml.tt2 @@ -0,0 +1,35 @@ +command: + hostname: + exit-status: 0 + +[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] + hostname: + exit-status: 0 + stdout: + - "spce" + stderr: [] + + hostname --fqdn: + exit-status: 0 + stdout: + - "spce." + stderr: [] + + hostname --short: + exit-status: 0 + stdout: + - "spce" + stderr: [] + +[% END -%] + "[ $(hostname --short). = $(hostname --fqdn) ]": + title: "short hostname should be the same as fqdn (ignoring trailing dot)" + exit-status: 0 + stdout: [] + stderr: [] + + "[ $(resolveip -s $(hostname --fqdn)) = $(resolveip -s $(hostname --short)) ]": + title: "ip-s of short hostname and fqdn should be the same" + exit-status: 0 + stdout: [] + stderr: [] diff --git a/ce/01_running-processes.json.tt2 b/ce/01_running-processes.json.tt2 deleted file mode 100644 index 838e5bd..0000000 --- a/ce/01_running-processes.json.tt2 +++ /dev/null @@ -1,97 +0,0 @@ -{ - "command": { - "pgrep -c -f '[l]ua5.1 /usr/bin/prosody'": { - "exit-status": 0, - "stdout": [ - "1" - ], - "stderr": [] - }, - "pgrep -c -f '[p]erl-fcgi-pm \\[NGCP::Panel\\]'": { - "exit-status": 0, - "stdout": [ - "1" - ], - "stderr": [] - }, - "pgrep -n -f '[k]amailio.*kamailio.proxy.pid'": { - "exit-status": 0, - "stdout": [ - "/[0-9]+/" - ], - "stderr": [] - }, - "pgrep -n -f '[k]amailio.*kamailio.lb.pid'": { - "exit-status": 0, - "stdout": [ - "/[0-9]+/" - ], - "stderr": [] - } - }, - "process": { - "acpid": { - "running": true - }, - "asterisk": { - "running": true - }, - "collectd": { - "running": true - }, - "collectdmon": { - "running": true - }, - "cron": { - "running": true - }, - "exim4": { - "running": true - }, - "getty": { - "running": true - }, - "kamailio": { - "running": true - }, - "mediator": { - "running": true - }, - "mysqld": { - "running": true - }, - "mysqld_safe": { - "running": true - }, - "ngcp-sems": { - "running": true - }, - "nginx": { - "running": true - }, - "ntpd": { - "running": true - }, - "perl-fcgi": { - "running": true - }, - "rate-o-mat": { - "running": true - }, - "redis-server": { - "running": true - }, - "rsyslogd": { - "running": true - }, - "rtpengine": { - "running": true - }, - "sshd": { - "running": true - }, - "udevd": { - "running": true - } - } -} diff --git a/ce/01_running-processes.yaml.tt2 b/ce/01_running-processes.yaml.tt2 new file mode 100644 index 0000000..f72cf30 --- /dev/null +++ b/ce/01_running-processes.yaml.tt2 @@ -0,0 +1,68 @@ +command: + "pgrep -c -f '[l]ua5.1 /usr/bin/prosody'": + exit-status: 0 + stdout: + - "1" + stderr: [] + + "pgrep -c -f '[p]erl-fcgi-pm \\[NGCP::Panel\\]'": + exit-status: 0 + stdout: + - "1" + stderr: [] + + "pgrep -n -f '[k]amailio.*kamailio.proxy.pid'": + exit-status: 0 + stdout: + - "/[0-9]+/" + stderr: [] + + "pgrep -n -f '[k]amailio.*kamailio.lb.pid'": + exit-status: 0 + stdout: + - "/[0-9]+/" + stderr: [] + +process: + acpid: + running: true + asterisk: + running: true + collectd: + running: true + collectdmon: + running: true + cron: + running: true + exim4: + running: true + getty: + running: true + kamailio: + running: true + mediator: + running: true + mysqld: + running: true + mysqld_safe: + running: true + ngcp-sems: + running: true + nginx: + running: true + ntpd: + running: true + perl-fcgi: + running: true + rate-o-mat: + running: true + redis-server: + running: true + rsyslogd: + running: true + rtpengine: + running: true + sshd: + running: true + udevd: + running: true diff --git a/ce/02_disk-free.json.tt2 b/ce/02_disk-free.json.tt2 deleted file mode 100644 index 0980b67..0000000 --- a/ce/02_disk-free.json.tt2 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "command": { - "df --output=pcent / | tail -1": { - "exit-status": 0, - "stdout": [ - "/[0-9]%|[0-7][0-9]%/" - ], - "stderr": [] - }, - "df --output=ipcent / | tail -1": { - "exit-status": 0, - "stdout": [ - "/[0-9]%|[0-7][0-9]%/" - ], - "stderr": [] - } - } -} diff --git a/ce/02_disk-free.yaml.tt2 b/ce/02_disk-free.yaml.tt2 new file mode 100644 index 0000000..cdce9cd --- /dev/null +++ b/ce/02_disk-free.yaml.tt2 @@ -0,0 +1,12 @@ +command: + "df --output=pcent / | tail -1": + exit-status: 0 + stdout: + - "/[0-9]%|[0-7][0-9]%/" + stderr: [] + + "df --output=ipcent / | tail -1": + exit-status: 0 + stdout: + - "/[0-9]%|[0-7][0-9]%/" + stderr: [] diff --git a/ce/03_files_availability.json.tt2 b/ce/03_files_availability.json.tt2 deleted file mode 100644 index 6c87a05..0000000 --- a/ce/03_files_availability.json.tt2 +++ /dev/null @@ -1,52 +0,0 @@ -{ - "file": { - "/etc/apt/sources.list.d/sipwise.list": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/config.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/constants.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/network.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp_version": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/sipwise_ngcp_version": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - } - } -} diff --git a/ce/03_files_availability.yaml.tt2 b/ce/03_files_availability.yaml.tt2 new file mode 100644 index 0000000..7e9a1f6 --- /dev/null +++ b/ce/03_files_availability.yaml.tt2 @@ -0,0 +1,48 @@ +file: + /etc/apt/sources.list.d/sipwise.list: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/config.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/constants.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/network.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp_version: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/sipwise_ngcp_version: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] diff --git a/ce/03_no-cores.json.tt2 b/ce/03_no-cores.json.tt2 deleted file mode 100644 index 5017209..0000000 --- a/ce/03_no-cores.json.tt2 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "command": { - "ls -la /var/cores/core.*": { - "exit-status": 2, - "stdout": [], - "stderr": [ - "ls: cannot access /var/cores/core.*: No such file or directory" - ] - } - } -} diff --git a/ce/03_no-cores.yaml.tt2 b/ce/03_no-cores.yaml.tt2 new file mode 100644 index 0000000..42cc6b7 --- /dev/null +++ b/ce/03_no-cores.yaml.tt2 @@ -0,0 +1,6 @@ +command: + "ls -la /var/cores/core.*": + exit-status: 2 + stdout: [] + stderr: + - "ls: cannot access /var/cores/core.*: No such file or directory" diff --git a/ce/03_open_ports.json.tt2 b/ce/03_open_ports.yaml.tt2 similarity index 57% rename from ce/03_open_ports.json.tt2 rename to ce/03_open_ports.yaml.tt2 index c32acbf..3577f07 100644 --- a/ce/03_open_ports.json.tt2 +++ b/ce/03_open_ports.yaml.tt2 @@ -9,15 +9,11 @@ PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; web_int_ips = out; -%] -{ - "port": { - "tcp:443": { - "listening": true, - "ip": ["[% web_ext_ips.0 -%]"] - }, - "tcp:1443": { - "listening": true, - "ip": ["[% web_int_ips.0 -%]"] - } - } -} +port: + tcp:443: + listening: true + ip: ["[% web_ext_ips.0 -%]"] + + tcp:1443: + listening: true + ip: ["[% web_int_ips.0 -%]"] diff --git a/ce/04_template_files.json.tt2 b/ce/04_template_files.json.tt2 deleted file mode 100644 index dd30954..0000000 --- a/ce/04_template_files.json.tt2 +++ /dev/null @@ -1,9 +0,0 @@ -{ - "command": { - "find /etc/ngcp-config/templates/ -type f ! \\( -name *.dpkg-dist -o -name *.dpkg-old -o -name *.dpkg-new -o -name *.dpkg-remove -o -name *.dpkg-bak -o -name *.dpkg-del \\) -print0 |xargs -0 dpkg -S \u003e/dev/null": { - "exit-status": 0, - "stdout": [], - "stderr": [] - } - } -} diff --git a/ce/04_template_files.yaml.tt2 b/ce/04_template_files.yaml.tt2 new file mode 100644 index 0000000..cf3e798 --- /dev/null +++ b/ce/04_template_files.yaml.tt2 @@ -0,0 +1,5 @@ +command: + "find /etc/ngcp-config/templates/ -type f ! \\( -name *.dpkg-dist -o -name *.dpkg-old -o -name *.dpkg-new -o -name *.dpkg-remove -o -name *.dpkg-bak -o -name *.dpkg-del \\) -print0 |xargs -0 dpkg -S \u003e/dev/null": + exit-status: 0 + stdout: [] + stderr: [] diff --git a/ce/05_system_users.json.tt2 b/ce/05_system_users.json.tt2 deleted file mode 100644 index dfbc9c0..0000000 --- a/ce/05_system_users.json.tt2 +++ /dev/null @@ -1,139 +0,0 @@ -{ - "group": { - "cdrexport": { - "exists": true, - "gid": 10001 - }, - "daemon": { - "exists": true, - "gid": 1 - }, - "kamailio": { - "exists": true - }, - "mysql": { - "exists": true - }, - "ntp": { - "exists": true - }, - "prosody": { - "exists": true - }, - "redis": { - "exists": true - }, - "root": { - "exists": true, - "gid": 0 - }, - "sems": { - "exists": true - }, - "sipwise": { - "exists": true, - "gid": 10000 - }, - "ssh": { - "exists": true - }, - "ssl-cert": { - "exists": true - }, - "sudo": { - "exists": true - }, - "www-data": { - "exists": true - } - }, - "user": { - "": { - "exists": false - }, - "cdrexport": { - "exists": true, - "uid": 10001, - "gid": 10001, - "groups": [ - "cdrexport" - ], - "home": "/home/jail/home/cdrexport" - }, - "kamailio": { - "exists": true, - "groups": [ - "kamailio", - "ssl-cert" - ], - "home": "/var/run/kamailio" - }, - "mysql": { - "exists": true, - "groups": [ - "mysql" - ], - "home": "/nonexistent" - }, - "nobody": { - "exists": true, - "groups": [ - "nogroup" - ], - "home": "/nonexistent" - }, - "prosody": { - "exists": true, - "groups": [ - "prosody", - "ssl-cert" - ], - "home": "/var/lib/prosody" - }, - "proxy": { - "exists": true, - "groups": [ - "proxy" - ], - "home": "/bin" - }, - "redis": { - "exists": true, - "groups": [ - "redis" - ], - "home": "/var/lib/redis" - }, - "sems": { - "exists": true, - "groups": [ - "sems" - ], - "home": "/var/run/ngcp-sems" - }, - "sipwise": { - "exists": true, - "uid": 10000, - "gid": 10000, - "groups": [ - "sipwise" - ], - "home": "/var/sipwise" - }, - "sshd": { - "exists": true, - "groups": [ - "nogroup" - ], - "home": "/var/run/sshd" - }, - "www-data": { - "exists": true, - "groups": [ - "ssl-cert", - "www-data" - ], - "home": "/var/www" - } - } -} diff --git a/ce/05_system_users.yaml.tt2 b/ce/05_system_users.yaml.tt2 new file mode 100644 index 0000000..f8d1777 --- /dev/null +++ b/ce/05_system_users.yaml.tt2 @@ -0,0 +1,123 @@ +group: + cdrexport: + exists: true + gid: 10001 + + daemon: + exists: true + gid: 1 + + kamailio: + exists: true + + mysql: + exists: true + + ntp: + exists: true + + prosody: + exists: true + + redis: + exists: true + + root: + exists: true + gid: 0 + + sems: + exists: true + + sipwise: + exists: true + gid: 10000 + + ssh: + exists: true + + ssl-cert: + exists: true + + sudo: + exists: true + + www-data: + exists: true + +user: + "": + exists: false + + cdrexport: + exists: true + uid: 10001 + gid: 10001 + groups: + - cdrexport + home: "/home/jail/home/cdrexport" + + kamailio: + exists: true + groups: + - kamailio + - ssl-cert + home: "/var/run/kamailio" + + mysql: + exists: true + groups: + - mysql + home: "/nonexistent" + + nobody: + exists: true + groups: + - nogroup + home: "/nonexistent" + + prosody: + exists: true + groups: + - prosody + - ssl-cert + home: "/var/lib/prosody" + + proxy: + exists: true + groups: + - proxy + home: "/bin" + + redis: + exists: true + groups: + - redis + home: "/var/lib/redis" + + sems: + exists: true + groups: + - sems + home: "/var/run/ngcp-sems" + + sipwise: + exists: true + uid: 10000 + gid: 10000 + groups: + - sipwise + home: "/var/sipwise" + + sshd: + exists: true + groups: + - nogroup + home: "/var/run/sshd" + + www-data: + exists: true + groups: + - ssl-cert + - www-data + home: "/var/www" diff --git a/ce/06_system_packages.json.tt2 b/ce/06_system_packages.json.tt2 deleted file mode 100644 index 9e2f799..0000000 --- a/ce/06_system_packages.json.tt2 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "package": { - "ngcp-ngcp-ce": { - "installed": true - }, - "ngcp-ngcp-pro": { - "installed": false - }, - "ngcp-ngcp-carrier": { - "installed": false - } - } -} diff --git a/ce/06_system_packages.yaml.tt2 b/ce/06_system_packages.yaml.tt2 new file mode 100644 index 0000000..56ff0bb --- /dev/null +++ b/ce/06_system_packages.yaml.tt2 @@ -0,0 +1,9 @@ +package: + ngcp-ngcp-ce: + installed: true + + ngcp-ngcp-pro: + installed: false + + ngcp-ngcp-carrier: + installed: false diff --git a/ce/07_system_service.json.tt2 b/ce/07_system_service.json.tt2 deleted file mode 100644 index 04c42d7..0000000 --- a/ce/07_system_service.json.tt2 +++ /dev/null @@ -1,84 +0,0 @@ -{ - "service": { - "acpid": { - "enabled": true, - "running": true - }, - "asterisk": { - "enabled": true, - "running": true - }, - "collectd": { - "enabled": true, - "running": true - }, - "cron": { - "enabled": true, - "running": true - }, - "exim4": { - "enabled": true, - "running": true - }, - "io-scheduler": { - "enabled": true, - "running": true - }, - "kamailio-lb": { - "enabled": true, - "running": true - }, - "kamailio-proxy": { - "enabled": true, - "running": true - }, - "mediator": { - "enabled": true, - "running": true - }, - "motd": { - "enabled": true, - "running": true - }, - "mysql": { - "enabled": true, - "running": true - }, - "ngcp-rate-o-mat": { - "enabled": true, - "running": true - }, - "ngcp-rtpengine-daemon": { - "enabled": true, - "running": true - }, - "ngcp-sems": { - "enabled": true, - "running": true - }, - "nginx": { - "enabled": true, - "running": true - }, - "ntp": { - "enabled": true, - "running": true - }, - "prosody": { - "enabled": true, - "running": true - }, - "redis-server": { - "enabled": true, - "running": true - }, - "rsyslog": { - "enabled": true, - "running": true - }, - "ssh": { - "enabled": true, - "running": true - } - } -} diff --git a/ce/07_system_service.yaml.tt2 b/ce/07_system_service.yaml.tt2 new file mode 100644 index 0000000..96fbe88 --- /dev/null +++ b/ce/07_system_service.yaml.tt2 @@ -0,0 +1,80 @@ +service: + acpid: + enabled: true + running: true + + asterisk: + enabled: true + running: true + + collectd: + enabled: true + running: true + + cron: + enabled: true + running: true + + exim4: + enabled: true + running: true + + io-scheduler: + enabled: true + running: true + + kamailio-lb: + enabled: true + running: true + + kamailio-proxy: + enabled: true + running: true + + mediator: + enabled: true + running: true + + motd: + enabled: true + running: true + + mysql: + enabled: true + running: true + + ngcp-rate-o-mat: + enabled: true + running: true + + ngcp-rtpengine-daemon: + enabled: true + running: true + + ngcp-sems: + enabled: true + running: true + + nginx: + enabled: true + running: true + + ntp: + enabled: true + running: true + + prosody: + enabled: true + running: true + + redis-server: + enabled: true + running: true + + rsyslog: + enabled: true + running: true + + ssh: + enabled: true + running: true diff --git a/ce/08_system_ports.json.tt2 b/ce/08_system_ports.json.tt2 deleted file mode 100644 index e92c34b..0000000 --- a/ce/08_system_ports.json.tt2 +++ /dev/null @@ -1,17 +0,0 @@ -{ - "port": { - "tcp:1443": { - "listening": true - }, - "tcp:22": { - "listening": true - }, - "tcp:443": { - "listening": true - }, - "tcp6:80": { - "comment": "why Ipv4 is not here?", - "listening": true - } - } -} diff --git a/ce/08_system_ports.yaml.tt2 b/ce/08_system_ports.yaml.tt2 new file mode 100644 index 0000000..86ece3c --- /dev/null +++ b/ce/08_system_ports.yaml.tt2 @@ -0,0 +1,13 @@ +port: + tcp:1443: + listening: true + + tcp:22: + listening: true + + tcp:443: + listening: true + + tcp6:80: + # why Ipv4 is not here? + listening: true diff --git a/ce/09_system_dns.json.tt2 b/ce/09_system_dns.json.tt2 deleted file mode 100644 index 0268194..0000000 --- a/ce/09_system_dns.json.tt2 +++ /dev/null @@ -1,20 +0,0 @@ -{ - "dns": { -[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] - "spce": { - "resolveable": true, - "addrs": [ - "127.0.0.2" - ], - "timeout": 500 - }, -[% END -%] - "localhost": { - "resolveable": true, - "addrs": [ - "127.0.0.1" - ], - "timeout": 500 - } - } -} diff --git a/ce/09_system_dns.yaml.tt2 b/ce/09_system_dns.yaml.tt2 new file mode 100644 index 0000000..f0f4bae --- /dev/null +++ b/ce/09_system_dns.yaml.tt2 @@ -0,0 +1,14 @@ +dns: +[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] + spce: + resolveable: true + addrs: + - 127.0.0.2 + timeout: 500 + +[% END -%] + localhost: + resolveable: true + addrs: + - 127.0.0.1 + timeout: 500 diff --git a/ce/10_sites_ok.json.tt2 b/ce/10_sites_ok.json.tt2 deleted file mode 100644 index c8be995..0000000 --- a/ce/10_sites_ok.json.tt2 +++ /dev/null @@ -1,237 +0,0 @@ -[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] -[% argv.host=hostname; argv.type='web_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - web_ext_ips = out --%] -[% IF !web_ext_ips.size -%] -[% argv.host=hostname; argv.type='web_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - web_ext_ips = out; --%] -[% END -%] -[% argv.host=hostname; argv.type='web_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - web_int_ips = out --%] -[% IF !web_int_ips.size -%] -[% argv.host=hostname; argv.type='web_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - web_int_ips = out; --%] -[% END -%] -[% - argv.host=hostname; argv.type='api_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - api_int_ips = out; - - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - api_int_ips = out.merge(api_int_ips); - - argv.role='mgmt'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_mgmt = out; - - argv.role='li'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_li = out; - is_li_enabled = is_li && cluster_sets.type == 'distributed' && intercept.enabled == 'yes'; --%] - -{ - "command": { - "curl --insecure -L http://[% web_ext_ips.0 -%]/": { - "exit-status": 0, - "stdout": [ - "/Subscriber Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - "curl --insecure -L https://[% web_ext_ips.0 -%]/": { - "exit-status": 0, - "stdout": [ - "/Subscriber Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - - "curl --insecure -L http://[% web_int_ips.0 -%]/login/admin": { - "exit-status": 0, - "stdout": [ - "/Admin Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - "curl --insecure -L https://[% web_int_ips.0 -%]/login/admin": { - "exit-status": 0, - "stdout": [ - "/Admin Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - - "curl --insecure -L http://[% web_int_ips.0 -%]:1443": { - "exit-status": 0, - "stdout": [ - "/Admin Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - "curl --insecure -L https://[% web_int_ips.0 -%]:1443": { - "exit-status": 0, - "stdout": [ - "/Admin Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - - "curl --insecure -L http://[% web_ext_ips.0 -%]:1443/login/subscriber": { - "exit-status": 0, - "stdout": [ - "/Subscriber Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - "curl --insecure -L https://[% web_ext_ips.0 -%]:1443/login/subscriber": { - "exit-status": 0, - "stdout": [ - "/Subscriber Sign In/" - ], - "stderr": [], - "timeout": 30000 - }, - - "curl --insecure -L http://[% web_int_ips.0 -%]:1443/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L https://[% web_int_ips.0 -%]:1443/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L http://administrator:administrator@[% web_int_ips.0 -%]:1443/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L https://administrator:administrator@[% web_int_ips.0 -%]:1443/api/": { - "exit-status": 0, - "stdout": [ - "/Sipwise NGCP HTTP API documentation/" - ], - "stderr": [], - "timeout": 30000 - }, - - "curl --insecure -L http://[% web_ext_ips.0 -%]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L https://[% web_ext_ips.0 -%]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - - "curl --insecure -L http://administrator:administrator@[% web_int_ips.0 -%]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L https://administrator:administrator@[% web_int_ips.0 -%]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - -[% IF www_admin.enabled == 'yes' && (is_mgmt || is_li_enabled) -%] - "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Sipwise NGCP HTTP API documentation/" - ], - "stderr": [], - "timeout": 30000 - }, - "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L http://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://fakeuser:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://[% credentials.rest_api.auth_system.u %]:wrongpassword@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://administrator:administrator@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, - "curl --insecure -L https://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": { - "exit-status": 0, - "stdout": [ - "/Authorization required/" - ], - "stderr": [], - "timeout": 10000 - }, -[% END -%] - - "curl -L http://localhost:8081/nginx_status": { - "exit-status": 0, - "stdout": [ - "/Active connections: [0-9]+/" - ], - "stderr": [], - "timeout": 10000 - } - } -} diff --git a/ce/10_sites_ok.yaml.tt2 b/ce/10_sites_ok.yaml.tt2 new file mode 100644 index 0000000..a4ec5e5 --- /dev/null +++ b/ce/10_sites_ok.yaml.tt2 @@ -0,0 +1,211 @@ +[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] +[% argv.host=hostname; argv.type='web_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + web_ext_ips = out +-%] +[% IF !web_ext_ips.size -%] +[% argv.host=hostname; argv.type='web_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + web_ext_ips = out; +-%] +[% END -%] +[% argv.host=hostname; argv.type='web_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + web_int_ips = out +-%] +[% IF !web_int_ips.size -%] +[% argv.host=hostname; argv.type='web_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + web_int_ips = out; +-%] +[% END -%] +[% + argv.host=hostname; argv.type='api_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + api_int_ips = out; + + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + api_int_ips = out.merge(api_int_ips); + + argv.role='mgmt'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_mgmt = out; + + argv.role='li'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_li = out; + is_li_enabled = is_li && cluster_sets.type == 'distributed' && intercept.enabled == 'yes'; +-%] + +command: + + "curl --insecure -L http://[% web_ext_ips.0 -%]/": + exit-status: 0 + stdout: + - "/Subscriber Sign In/" + stderr: [] + timeout: 30000 + + "curl --insecure -L https://[% web_ext_ips.0 -%]/": + exit-status: 0 + stdout: + - "/Subscriber Sign In/" + stderr: [] + timeout: 30000 + + + "curl --insecure -L http://[% web_int_ips.0 -%]/login/admin": + exit-status: 0 + stdout: + - "/Admin Sign In/" + stderr: [] + timeout: 30000 + + "curl --insecure -L https://[% web_int_ips.0 -%]/login/admin": + exit-status: 0 + stdout: + - "/Admin Sign In/" + stderr: [] + timeout: 30000 + + + "curl --insecure -L http://[% web_int_ips.0 -%]:1443": + exit-status: 0 + stdout: + - "/Admin Sign In/" + stderr: [] + timeout: 30000 + + "curl --insecure -L https://[% web_int_ips.0 -%]:1443": + exit-status: 0 + stdout: + - "/Admin Sign In/" + stderr: [] + timeout: 30000 + + + "curl --insecure -L http://[% web_ext_ips.0 -%]:1443/login/subscriber": + exit-status: 0 + stdout: + - "/Subscriber Sign In/" + stderr: [] + timeout: 30000 + + "curl --insecure -L https://[% web_ext_ips.0 -%]:1443/login/subscriber": + exit-status: 0 + stdout: + - "/Subscriber Sign In/" + stderr: [] + timeout: 30000 + + + "curl --insecure -L http://[% web_int_ips.0 -%]:1443/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L https://[% web_int_ips.0 -%]:1443/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L http://administrator:administrator@[% web_int_ips.0 -%]:1443/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L https://administrator:administrator@[% web_int_ips.0 -%]:1443/api/": + exit-status: 0 + stdout: + - "/Sipwise NGCP HTTP API documentation/" + stderr: [] + timeout: 30000 + + + "curl --insecure -L http://[% web_ext_ips.0 -%]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L https://[% web_ext_ips.0 -%]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + + "curl --insecure -L http://administrator:administrator@[% web_int_ips.0 -%]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L https://administrator:administrator@[% web_int_ips.0 -%]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + +[% IF www_admin.enabled == 'yes' && (is_mgmt || is_li_enabled) -%] + "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Sipwise NGCP HTTP API documentation/" + stderr: [] + timeout: 30000 + + "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L http://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://fakeuser:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://[% credentials.rest_api.auth_system.u %]:wrongpassword@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl -H 'NGCP-UserAgent: NGCP::API::Client' --insecure -L https://administrator:administrator@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + + "curl --insecure -L https://[% credentials.rest_api.auth_system.u %]:[% credentials.rest_api.auth_system.p %]@[% api_int_ips.0 -%]:[% www_admin.http_system.port %]/api/": + exit-status: 0 + stdout: + - "/Authorization required/" + stderr: [] + timeout: 10000 + +[% END -%] + + "curl -L http://localhost:8081/nginx_status": + exit-status: 0 + stdout: + - "/Active connections: [0-9]+/" + stderr: [] + timeout: 10000 diff --git a/ce/99_dummy.json.tt2 b/ce/99_dummy.json.tt2 deleted file mode 100644 index 131c6e0..0000000 --- a/ce/99_dummy.json.tt2 +++ /dev/null @@ -1,14 +0,0 @@ -{ - "command": { - "false": { - "exit-status": 1, - "stdout": [], - "stderr": [] - }, - "true": { - "exit-status": 0, - "stdout": [], - "stderr": [] - } - } -} diff --git a/ce/99_dummy.yaml.tt2 b/ce/99_dummy.yaml.tt2 new file mode 100644 index 0000000..b6a86db --- /dev/null +++ b/ce/99_dummy.yaml.tt2 @@ -0,0 +1,9 @@ +command: + false: + exit-status: 1 + stdout: [] + stderr: [] + true: + exit-status: 0 + stdout: [] + stderr: [] diff --git a/ce/goss.json.tt2 b/ce/goss.json.tt2 deleted file mode 100644 index 23c862f..0000000 --- a/ce/goss.json.tt2 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "gossfile": { - "01_running-processes.json": {}, - "01_hostname-and-interfaces.json": {}, - "02_disk-free.json": {}, - "03_files_availability.json": {}, - "03_no-cores.json": {}, - "03_open_ports.json": {}, - "04_template_files.json": {}, - "05_system_users.json": {}, - "06_system_packages.json": {}, - "07_system_service.json": {}, - "08_system_ports.json": {}, - "09_system_dns.json": {}, - "10_sites_ok.json": {}, - "99_dummy.json": {} - } -} diff --git a/ce/goss.yaml.tt2 b/ce/goss.yaml.tt2 new file mode 100644 index 0000000..bfd4624 --- /dev/null +++ b/ce/goss.yaml.tt2 @@ -0,0 +1,15 @@ +gossfile: + 01_running-processes.yaml: {} + 01_hostname-and-interfaces.yaml: {} + 02_disk-free.yaml: {} + 03_files_availability.yaml: {} + 03_no-cores.yaml: {} + 03_open_ports.yaml: {} + 04_template_files.yaml: {} + 05_system_users.yaml: {} + 06_system_packages.yaml: {} + 07_system_service.yaml: {} + 08_system_ports.yaml: {} + 09_system_dns.yaml: {} + 10_sites_ok.yaml: {} + 99_dummy.yaml: {} diff --git a/pro/01_hostname-and-interfaces.json.tt2 b/pro/01_hostname-and-interfaces.json.tt2 deleted file mode 100644 index b9f12d9..0000000 --- a/pro/01_hostname-and-interfaces.json.tt2 +++ /dev/null @@ -1,42 +0,0 @@ -{ - "command": { - "hostname": { - "exit-status": 0 - }, -[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] - "hostname": { - "exit-status": 0, - "stdout": [ - "/sp[1,2]/" - ], - "stderr": [] - }, - "hostname --fqdn": { - "exit-status": 0, - "stdout": [ - "/sp[1,2]/" - ], - "stderr": [] - }, - "hostname --short": { - "exit-status": 0, - "stdout": [ - "/sp[1,2]/" - ], - "stderr": [] - }, -[% END -%] - "[ $(hostname --short) = $(hostname --fqdn) ]": { - "comment": "short hostname should be the same as fqdn (ignoring trailing dot)", - "exit-status": 0, - "stdout": [], - "stderr": [] - }, - "[ $(resolveip -s $(hostname --fqdn)) = $(resolveip -s $(hostname --short)) ]": { - "comment": "ip-s of short hostname and fqdn should be the same", - "exit-status": 0, - "stdout": [], - "stderr": [] - } - } -} diff --git a/pro/01_hostname-and-interfaces.yaml.tt2 b/pro/01_hostname-and-interfaces.yaml.tt2 new file mode 100644 index 0000000..dda74c4 --- /dev/null +++ b/pro/01_hostname-and-interfaces.yaml.tt2 @@ -0,0 +1,35 @@ +command: + hostname: + exit-status: 0 + +[% IF sipwise.system_tester.skip_strict_hostname_test != "true" %] + hostname: + exit-status: 0 + stdout: + - "/sp[1,2]/" + stderr: [] + + "hostname --fqdn": + exit-status: 0 + stdout: + - "/sp[1,2]/" + stderr: [] + + "hostname --short": + exit-status: 0 + stdout: + - "/sp[1,2]/" + stderr: [] + +[% END -%] + "[ $(hostname --short) = $(hostname --fqdn) ]": + title: "short hostname should be the same as fqdn (ignoring trailing dot)" + exit-status: 0 + stdout: [] + stderr: [] + + "[ $(resolveip -s $(hostname --fqdn)) = $(resolveip -s $(hostname --short)) ]": + title: "ip-s of short hostname and fqdn should be the same" + exit-status: 0 + stdout: [] + stderr: [] diff --git a/pro/01_running-processes.json.tt2 b/pro/01_running-processes.json.tt2 deleted file mode 100644 index 58a5cfc..0000000 --- a/pro/01_running-processes.json.tt2 +++ /dev/null @@ -1,115 +0,0 @@ -{ - "command": { - "pgrep -c -f '[l]ua5.1 /usr/bin/prosody'": { - "exit-status": 0, - "stdout": [ - "1" - ], - "stderr": [] - }, - "pgrep -c -f '[p]erl-fcgi-pm \\[NGCP::Panel\\]'": { - "exit-status": 0, - "stdout": [ - "1" - ], - "stderr": [] - }, - "pgrep -n -f '[k]amailio.*kamailio.proxy.pid'": { - "exit-status": 0, - "stdout": [ - "/[0-9]+/" - ], - "stderr": [] - }, - "pgrep -n -f '[k]amailio.*kamailio.lb.pid'": { - "exit-status": 0, - "stdout": [ - "/[0-9]+/" - ], - "stderr": [] - } - }, - "process": { - "acpid": { - "running": true - }, - "asterisk": { - "running": true - }, - "collectd": { - "running": true - }, - "collectdmon": { - "running": true - }, - "cron": { - "running": true - }, - "exim4": { - "running": true - }, - "glusterfs": { - "running": true - }, - "hb_watchdog": { - "running": true - }, - "heartbeat": { - "running": true - }, - "kamailio": { - "running": true - }, - "mediator": { - "running": true - }, - "mysqld": { - "running": true - }, - "mysqld_safe": { - "running": true - }, - "monit": { - "running": true - }, - "ngcp-faxserver": { - "running": true - }, - "ngcp-sems": { - "running": true - }, - "nginx": { - "running": true - }, - "ntpd": { - "running": true - }, - "perl-fcgi": { - "running": true - }, - "rate-o-mat": { - "running": true - }, - "redis-server": { - "running": true - }, - "rsyslogd": { - "running": true - }, - "rtpengine": { - "running": true - }, - "sshd": { - "running": true - }, - "snmpd": { - "running": true - }, - "udevd": { - "running": true - }, - "voisniff-ng": { - "running": true - } - } -} diff --git a/pro/01_running-processes.yaml.tt2 b/pro/01_running-processes.yaml.tt2 new file mode 100644 index 0000000..fb49106 --- /dev/null +++ b/pro/01_running-processes.yaml.tt2 @@ -0,0 +1,107 @@ +command: + + "pgrep -c -f '[l]ua5.1 /usr/bin/prosody'": + exit-status: 0 + stdout: + - "1" + stderr: [] + + "pgrep -c -f '[p]erl-fcgi-pm \\[NGCP::Panel\\]'": + exit-status: 0 + stdout: + - "1" + stderr: [] + + "pgrep -n -f '[k]amailio.*kamailio.proxy.pid'": + exit-status: 0 + stdout: + - "/[0-9]+/" + stderr: [] + + "pgrep -n -f '[k]amailio.*kamailio.lb.pid'": + exit-status: 0 + stdout: + - "/[0-9]+/" + stderr: [] + +process: + acpid: + running: true + + asterisk: + running: true + + collectd: + running: true + + collectdmon: + running: true + + cron: + running: true + + exim4: + running: true + + glusterfs: + running: true + + hb_watchdog: + running: true + + heartbeat: + running: true + + kamailio: + running: true + + mediator: + running: true + + mysqld: + running: true + + mysqld_safe: + running: true + + monit: + running: true + + ngcp-faxserver: + running: true + + ngcp-sems: + running: true + + nginx: + running: true + + ntpd: + running: true + + perl-fcgi: + running: true + + rate-o-mat: + running: true + + redis-server: + running: true + + rsyslogd: + running: true + + rtpengine: + running: true + + sshd: + running: true + + snmpd: + running: true + + udevd: + running: true + + voisniff-ng: + running: true diff --git a/pro/02_disk-free.json.tt2 b/pro/02_disk-free.json.tt2 deleted file mode 120000 index 467a066..0000000 --- a/pro/02_disk-free.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/02_disk-free.json.tt2 \ No newline at end of file diff --git a/pro/02_disk-free.yaml.tt2 b/pro/02_disk-free.yaml.tt2 new file mode 120000 index 0000000..8093325 --- /dev/null +++ b/pro/02_disk-free.yaml.tt2 @@ -0,0 +1 @@ +../ce/02_disk-free.yaml.tt2 \ No newline at end of file diff --git a/pro/03_files_availability.json.tt2 b/pro/03_files_availability.json.tt2 deleted file mode 100644 index 65d341e..0000000 --- a/pro/03_files_availability.json.tt2 +++ /dev/null @@ -1,52 +0,0 @@ -{ - "file": { - "/etc/apt/sources.list.d/sipwise.list": { - "exists": true, - "mode": "0444", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/config.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/constants.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp-config/network.yml": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/ngcp_version": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - }, - "/etc/sipwise_ngcp_version": { - "exists": true, - "mode": "0644", - "owner": "root", - "group": "root", - "filetype": "file", - "contains": [] - } - } -} diff --git a/pro/03_files_availability.yaml.tt2 b/pro/03_files_availability.yaml.tt2 new file mode 100644 index 0000000..7fe9418 --- /dev/null +++ b/pro/03_files_availability.yaml.tt2 @@ -0,0 +1,49 @@ +file: + + /etc/apt/sources.list.d/sipwise.list: + exists: true + mode: "0444" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/config.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/constants.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp-config/network.yml: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/ngcp_version: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + + /etc/sipwise_ngcp_version: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] diff --git a/pro/03_no-cores.json.tt2 b/pro/03_no-cores.json.tt2 deleted file mode 120000 index e3ae2a5..0000000 --- a/pro/03_no-cores.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/03_no-cores.json.tt2 \ No newline at end of file diff --git a/pro/03_no-cores.yaml.tt2 b/pro/03_no-cores.yaml.tt2 new file mode 120000 index 0000000..4fdd438 --- /dev/null +++ b/pro/03_no-cores.yaml.tt2 @@ -0,0 +1 @@ +../ce/03_no-cores.yaml.tt2 \ No newline at end of file diff --git a/pro/03_open_ports.json.tt2 b/pro/03_open_ports.json.tt2 deleted file mode 100644 index c7208a3..0000000 --- a/pro/03_open_ports.json.tt2 +++ /dev/null @@ -1,193 +0,0 @@ -[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] -[% argv.host=hostname; argv.role='proxy'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_proxy = out --%] -[% argv.host=hostname; argv.role='lb'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_lb = out --%] -[% argv.host=hostname; argv.role='mgmt'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_mgmt = out --%] -[% argv.host=hostname; argv.role='db'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_db = out --%] -[% argv.host=hostname; argv.role='rtp'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_rtp = out --%] -[% argv.host=hostname; argv.type='ha_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_iface'; - host_ha_iface = out --%] -[% argv.host=hostname; argv.type='sip_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - sip_ext_ips = out --%] -[% IF !sip_ext_ips.size -%] -[% argv.host=hostname; argv.type='sip_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - sip_ext_ips = out; --%] -[% END -%] -[% argv.host=hostname; argv.type='web_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - web_ext_ips = out --%] -[% IF !web_ext_ips.size -%] -[% argv.host=hostname; argv.type='web_ext'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - web_ext_ips = out; --%] -[% END -%] -[% argv.host=hostname; argv.type='web_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; - web_int_ips = out --%] -[% IF !web_int_ips.size -%] -[% argv.host=hostname; argv.type='web_int'; - PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; - web_int_ips = out; --%] -[% END -%] -{ - "port": { -[% IF is_mgmt -%] - "tcp:443": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:1443": { - "listening": true, - "ip": ["127.0.0.1"] - }, -[% END -%] -[% IF is_mgmt && pbx.enable == 'yes' -%] - "tcp:1444": { - "listening": true, - "ip": ["[% web_ext_ips.0 -%]"] - }, - "tcp:1445": { - "listening": true, - "ip": ["[% web_ext_ips.0 -%]"] - }, -[% END -%] - "tcp:22": { - "listening": true, - "ip": ["0.0.0.0"] - }, - "tcp:22": { - "listening": true, - "ip": ["[% hosts.$hostname.$host_ha_iface.ip %]"] - }, - "tcp:24009": { - "listening": true, - "ip": ["0.0.0.0"] - }, - "tcp:25": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:2812": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:3306": { - "listening": true, - "ip": ["0.0.0.0"] - }, -[% IF is_lb -%] - "tcp:5060": { - "listening": true, - "ip": ["[% sip_ext_ips.0 -%]"] - }, -[% END -%] -[% IF is_proxy -%] - "tcp:5062": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:5222": { - "listening": true, - "ip": ["[% sip_ext_ips.0 -%]"] - }, - "tcp:5269": { - "listening": true, - "ip": ["[% sip_ext_ips.0 -%]"] - }, - "tcp:5280": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:5281": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:5582": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:8090": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "tcp:5038": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "udp:5040": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "udp:5070": { - "listening": true, - "ip": ["127.0.0.1"] - }, - "udp:5080": { - "listening": true, - "ip": ["127.0.0.1"] - }, -[% END -%] -[% IF is_rtp || is_proxy || is_db -%] - "tcp:6379": { - "listening": true, - "ip": ["[% hosts.$hostname.$host_ha_iface.ip %]"] - }, -[% END -%] - "tcp:7777": { - "listening": false - }, - "udp:7777": { - "listening": false - }, - "udp:123": { - "listening": true, - "ip": ["0.0.0.0"] - }, - "udp:161": { - "listening": true, - "ip": ["127.0.0.1"] - }, -[% IF is_rtp -%] - "udp:2223": { - "listening": true, - "ip": ["127.0.0.1"] - }, -[% END -%] - "udp:25826": { - "listening": true, - "ip": ["[% hosts.$hostname.$host_ha_iface.ip %]"] - }, - "udp:[% heartbeat.port ? heartbeat.port : '694' %]": { - "listening": true, - "ip": ["0.0.0.0"] - }, - "tcp:22": { - "listening": true, - "comment": "last record to keep JSON valid" - } - } -} diff --git a/pro/03_open_ports.yaml.tt2 b/pro/03_open_ports.yaml.tt2 new file mode 100644 index 0000000..5a53d75 --- /dev/null +++ b/pro/03_open_ports.yaml.tt2 @@ -0,0 +1,191 @@ +[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] +[% argv.host=hostname; argv.role='proxy'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_proxy = out +-%] +[% argv.host=hostname; argv.role='lb'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_lb = out +-%] +[% argv.host=hostname; argv.role='mgmt'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_mgmt = out +-%] +[% argv.host=hostname; argv.role='db'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_db = out +-%] +[% argv.host=hostname; argv.role='rtp'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_rtp = out +-%] +[% argv.host=hostname; argv.type='ha_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_iface'; + host_ha_iface = out +-%] +[% argv.host=hostname; argv.type='sip_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + sip_ext_ips = out +-%] +[% IF !sip_ext_ips.size -%] +[% argv.host=hostname; argv.type='sip_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + sip_ext_ips = out; +-%] +[% END -%] +[% argv.host=hostname; argv.type='web_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + web_ext_ips = out +-%] +[% IF !web_ext_ips.size -%] +[% argv.host=hostname; argv.type='web_ext'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + web_ext_ips = out; +-%] +[% END -%] +[% argv.host=hostname; argv.type='web_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host'; + web_int_ips = out +-%] +[% IF !web_int_ips.size -%] +[% argv.host=hostname; argv.type='web_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + web_int_ips = out; +-%] +[% END -%] + +port: + +[% IF is_mgmt -%] + tcp:443: + listening: true + ip: ["127.0.0.1"] + + tcp:1443: + listening: true + ip: ["127.0.0.1"] + +[% END -%] +[% IF is_mgmt && pbx.enable == 'yes' -%] + tcp:1444: + listening: true + ip: ["[% web_ext_ips.0 -%]"] + + tcp:1445: + listening: true + ip: ["[% web_ext_ips.0 -%]"] + +[% END -%] + tcp:22: + listening: true + ip: ["0.0.0.0"] + + tcp:22: + listening: true + ip: ["[% hosts.$hostname.$host_ha_iface.ip %]"] + + tcp:24009: + listening: true + ip: ["0.0.0.0"] + + tcp:25: + listening: true + ip: ["127.0.0.1"] + + tcp:2812: + listening: true + ip: ["127.0.0.1"] + + tcp:3306: + listening: true + ip: ["0.0.0.0"] + +[% IF is_lb -%] + tcp:5060: + listening: true + ip: ["[% sip_ext_ips.0 -%]"] + +[% END -%] +[% IF is_proxy -%] + tcp:5062: + listening: true + ip: ["127.0.0.1"] + + tcp:5222: + listening: true + ip: ["[% sip_ext_ips.0 -%]"] + + tcp:5269: + listening: true + ip: ["[% sip_ext_ips.0 -%]"] + + tcp:5280: + listening: true + ip: ["127.0.0.1"] + + tcp:5281: + listening: true + ip: ["127.0.0.1"] + + tcp:5582: + listening: true + ip: ["127.0.0.1"] + + tcp:8090: + listening: true + ip: ["127.0.0.1"] + + tcp:5038: + listening: true + ip: ["127.0.0.1"] + + udp:5040: + listening: true + ip: ["127.0.0.1"] + + udp:5070: + listening: true + ip: ["127.0.0.1"] + + udp:5080: + listening: true + ip: ["127.0.0.1"] + +[% END -%] +[% IF is_rtp || is_proxy || is_db -%] + tcp:6379: + listening: true + ip: ["[% hosts.$hostname.$host_ha_iface.ip %]"] + +[% END -%] + tcp:7777: + listening: false + + udp:7777: + listening: false + + udp:123: + listening: true + ip: ["0.0.0.0"] + + udp:161: + listening: true + ip: ["127.0.0.1"] + +[% IF is_rtp -%] + udp:2223: + listening: true + ip: ["127.0.0.1"] + +[% END -%] + udp:25826: + listening: true + ip: ["[% hosts.$hostname.$host_ha_iface.ip %]"] + + udp:[% heartbeat.port ? heartbeat.port : '694' %]: + listening: true + ip: ["0.0.0.0"] + + tcp:22: + # last record to keep JSON valid + listening: true diff --git a/pro/04_template_files.json.tt2 b/pro/04_template_files.json.tt2 deleted file mode 120000 index cc5f3fa..0000000 --- a/pro/04_template_files.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/04_template_files.json.tt2 \ No newline at end of file diff --git a/pro/04_template_files.yaml.tt2 b/pro/04_template_files.yaml.tt2 new file mode 120000 index 0000000..be17fb9 --- /dev/null +++ b/pro/04_template_files.yaml.tt2 @@ -0,0 +1 @@ +../ce/04_template_files.yaml.tt2 \ No newline at end of file diff --git a/pro/05_system_users.json.tt2 b/pro/05_system_users.json.tt2 deleted file mode 120000 index 008427a..0000000 --- a/pro/05_system_users.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/05_system_users.json.tt2 \ No newline at end of file diff --git a/pro/05_system_users.yaml.tt2 b/pro/05_system_users.yaml.tt2 new file mode 120000 index 0000000..ccc24da --- /dev/null +++ b/pro/05_system_users.yaml.tt2 @@ -0,0 +1 @@ +../ce/05_system_users.yaml.tt2 \ No newline at end of file diff --git a/pro/06_system_packages.json.tt2 b/pro/06_system_packages.json.tt2 deleted file mode 100644 index af52fa6..0000000 --- a/pro/06_system_packages.json.tt2 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "package": { - "ngcp-ngcp-ce": { - "installed": false - }, - "ngcp-ngcp-pro": { - "installed": true - }, - "ngcp-ngcp-carrier": { - "installed": false - } - } -} diff --git a/pro/06_system_packages.yaml.tt2 b/pro/06_system_packages.yaml.tt2 new file mode 100644 index 0000000..4cbadcd --- /dev/null +++ b/pro/06_system_packages.yaml.tt2 @@ -0,0 +1,9 @@ +package: + ngcp-ngcp-ce: + installed: false + + ngcp-ngcp-pro: + installed: true + + ngcp-ngcp-carrier: + installed: false diff --git a/pro/07_system_service.json.tt2 b/pro/07_system_service.json.tt2 deleted file mode 100644 index e1e5861..0000000 --- a/pro/07_system_service.json.tt2 +++ /dev/null @@ -1,215 +0,0 @@ -[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] -[% argv.host=hostname; argv.role='proxy'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_proxy = out --%] -[% argv.host=hostname; argv.role='lb'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_lb = out --%] -[% argv.host=hostname; argv.role='mgmt'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_mgmt = out --%] -[% argv.host=hostname; argv.role='db'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_db = out --%] -[% argv.host=hostname; argv.role='rtp'; - PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; - is_rtp = out --%] -[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_ngcp_type'; ngcp_type = out -%] -{ - "service": { - "acpid": { - "enabled": true, - "running": true - }, -[% IF is_proxy && asterisk.enabled == "yes" -%] - "asterisk": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF (is_proxy || is_rtp) && intercept.enabled == "yes" -%] - "captagent": { - "enabled": false, - "running": true - }, -[% END -%] - "collectd": { - "enabled": true, - "running": true - }, -[% IF turnserver.enabled == 'yes' -%] - "coturn": { - "enabled": false, - "running": true - }, -[% END -%] - "cron": { - "enabled": true, - "running": true - }, -[% IF bootenv.dhcp.enable == 'yes' -%] - "dnsmasq": { - "enabled": false, - "running": true - }, -[% END -%] - "exim4": { - "enabled": true, - "running": true - }, -[% IF haproxy.enable == "yes" -%] - "haproxy": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF heartbeat.hb_watchdog.enable == 'yes' -%] - "hb_watchdog": { - "enabled": true, - "running": true - }, -[% END -%] - "io-scheduler": { - "enabled": true, - "running": true - }, -[% IF is_lb && kamailio.lb.start == "yes" -%] - "kamailio-lb": { - "enabled": false, - "running": true - }, -[% ELSE -%] - "kamailio-lb": { - "enabled": false, - "running": false - }, -[% END -%] -[% IF is_proxy && kamailio.proxy.start == "yes" -%] - "kamailio-proxy": { - "enabled": false, - "running": true - }, -[% ELSE -%] - "kamailio-proxy": { - "enabled": false, - "running": false - }, -[% END -%] -[% IF mediator.enabled == 'yes' -%] - "mediator": { - "enabled": false, - "running": true - }, -[% END -%] - "motd": { - "enabled": true, - "running": true - }, - "mysql": { - "enabled": true, - "running": true - }, -[% IF www_admin.enabled == 'yes' -%] - "ngcp-panel": { - "enabled": true, - "running": true - }, -[% END -%] -[% IF rateomat.enable == "yes" -%] - "ngcp-rate-o-mat": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF rtpproxy.enabled == "yes" -%] - "ngcp-rtpengine-daemon": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF sems.enabled == "yes" -%] - - "ngcp-sems": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF nginx.enabled == 'yes' -%] - "nginx": { - "enabled": true, - "running": true - }, -[% END -%] - "ntp": { - "enabled": true, - "running": true - }, -[% IF prosody.enabled == 'yes' -%] - "prosody": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF pushd.enable == "yes" -%] - "ngcp-pushd": { - "enabled": true, - "running": true - }, -[% END -%] -[% IF faxserver.enable == "yes" -%] - "ngcp-faxserver": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF redis.enabled == "yes" -%] - "redis-server": { - "enabled": true, - "running": true - }, -[% END -%] - "rsyslog": { - "enabled": true, - "running": true - }, -[% IF ldap.enabled == "yes" -%] - "slapd": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF pbx.enable == "yes" -%] - "sems-pbx": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF (is_proxy || is_lb || is_rtp) && voisniff.daemon.start == 'yes' -%] - "voisniff-ng": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF ngcp_type == 'carrier' -%] - "ngcpcfg-api": { - "enabled": false, - "running": true - }, -[% END -%] -[% IF (is_db || is_mgmt) && ngcp_type == 'carrier' -%] - "elasticsearch": { - "enabled": true, - "running": true - }, -[% END -%] - "ssh": { - "enabled": true, - "running": true - } - } -} diff --git a/pro/07_system_service.yaml.tt2 b/pro/07_system_service.yaml.tt2 new file mode 100644 index 0000000..c63085f --- /dev/null +++ b/pro/07_system_service.yaml.tt2 @@ -0,0 +1,213 @@ +[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; hostname = out -%] +[% argv.host=hostname; argv.role='proxy'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_proxy = out +-%] +[% argv.host=hostname; argv.role='lb'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_lb = out +-%] +[% argv.host=hostname; argv.role='mgmt'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_mgmt = out +-%] +[% argv.host=hostname; argv.role='db'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_db = out +-%] +[% argv.host=hostname; argv.role='rtp'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_rtp = out +-%] +[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_ngcp_type'; ngcp_type = out -%] + +service: + + acpid: + enabled: true + running: true + +[% IF is_proxy && asterisk.enabled == "yes" -%] + asterisk: + enabled: false + running: true + +[% END -%] +[% IF (is_proxy || is_rtp) && intercept.enabled == "yes" -%] + captagent: + enabled: false + running: true + +[% END -%] + collectd: + enabled: true + running: true + +[% IF turnserver.enabled == 'yes' -%] + coturn: + enabled: false + running: true + +[% END -%] + cron: + enabled: true + running: true + +[% IF bootenv.dhcp.enable == 'yes' -%] + dnsmasq: + enabled: false + running: true + +[% END -%] + exim4: + enabled: true + running: true + +[% IF haproxy.enable == "yes" -%] + haproxy: + enabled: false + running: true + +[% END -%] +[% IF heartbeat.hb_watchdog.enable == 'yes' -%] + hb_watchdog: + enabled: true + running: true + +[% END -%] + io-scheduler: + enabled: true + running: true + +[% IF is_lb && kamailio.lb.start == "yes" -%] + kamailio-lb: + enabled: false + running: true + +[% ELSE -%] + kamailio-lb: + enabled: false + running: false + +[% END -%] +[% IF is_proxy && kamailio.proxy.start == "yes" -%] + kamailio-proxy: + enabled: false + running: true + +[% ELSE -%] + kamailio-proxy: + enabled: false + running: false + +[% END -%] +[% IF mediator.enabled == 'yes' -%] + mediator: + enabled: false + running: true + +[% END -%] + motd: + enabled: true + running: true + + mysql: + enabled: true + running: true + +[% IF www_admin.enabled == 'yes' -%] + ngcp-panel: + enabled: true + running: true + +[% END -%] +[% IF rateomat.enable == "yes" -%] + ngcp-rate-o-mat: + enabled: false + running: true + +[% END -%] +[% IF rtpproxy.enabled == "yes" -%] + ngcp-rtpengine-daemon: + enabled: false + running: true + +[% END -%] +[% IF sems.enabled == "yes" -%] + + ngcp-sems: + enabled: false + running: true + +[% END -%] +[% IF nginx.enabled == 'yes' -%] + nginx: + enabled: true + running: true + +[% END -%] + ntp: + enabled: true + running: true + +[% IF prosody.enabled == 'yes' -%] + prosody: + enabled: false + running: true + +[% END -%] +[% IF pushd.enable == "yes" -%] + ngcp-pushd: + enabled: true + running: true + +[% END -%] +[% IF faxserver.enable == "yes" -%] + ngcp-faxserver: + enabled: false + running: true + +[% END -%] +[% IF redis.enabled == "yes" -%] + redis-server: + enabled: true + running: true + +[% END -%] + rsyslog: + enabled: true + running: true + +[% IF ldap.enabled == "yes" -%] + slapd: + enabled: false + running: true + +[% END -%] +[% IF pbx.enable == "yes" -%] + sems-pbx: + enabled: false + running: true + +[% END -%] +[% IF (is_proxy || is_lb || is_rtp) && voisniff.daemon.start == 'yes' -%] + voisniff-ng: + enabled: false + running: true + +[% END -%] +[% IF ngcp_type == 'carrier' -%] + ngcpcfg-api: + enabled: false + running: true + +[% END -%] +[% IF (is_db || is_mgmt) && ngcp_type == 'carrier' -%] + elasticsearch: + enabled: true + running: true + +[% END -%] + ssh: + enabled: true + running: true diff --git a/pro/08_system_ports.json.tt2 b/pro/08_system_ports.json.tt2 deleted file mode 120000 index 6cc8e2e..0000000 --- a/pro/08_system_ports.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/08_system_ports.json.tt2 \ No newline at end of file diff --git a/pro/08_system_ports.yaml.tt2 b/pro/08_system_ports.yaml.tt2 new file mode 120000 index 0000000..45e4d1f --- /dev/null +++ b/pro/08_system_ports.yaml.tt2 @@ -0,0 +1 @@ +../ce/08_system_ports.yaml.tt2 \ No newline at end of file diff --git a/pro/09_system_dns.json.tt2 b/pro/09_system_dns.json.tt2 deleted file mode 100644 index 18ca40d..0000000 --- a/pro/09_system_dns.json.tt2 +++ /dev/null @@ -1,27 +0,0 @@ -{ - "dns": { -[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] - "sp1": { - "resolveable": true, - "addrs": [ - "192.168.255.251" - ], - "timeout": 500 - }, - "sp2": { - "resolveable": true, - "addrs": [ - "192.168.255.252" - ], - "timeout": 500 - }, -[% END -%] - "localhost": { - "resolveable": true, - "addrs": [ - "127.0.0.1" - ], - "timeout": 500 - } - } -} \ No newline at end of file diff --git a/pro/09_system_dns.yaml.tt2 b/pro/09_system_dns.yaml.tt2 new file mode 100644 index 0000000..52cd6d4 --- /dev/null +++ b/pro/09_system_dns.yaml.tt2 @@ -0,0 +1,21 @@ +dns: + +[% IF sipwise.system_tester.skip_dns_check_test != "true" -%] + sp1: + resolveable: true + addrs: + - 192.168.255.251 + timeout: 500 + + sp2: + resolveable: true + addrs: + - 192.168.255.252 + timeout: 500 + +[% END -%] + localhost: + resolveable: true + addrs: + - 127.0.0.1 + timeout: 500 diff --git a/pro/10_sites_ok.json.tt2 b/pro/10_sites_ok.json.tt2 deleted file mode 120000 index 1507ff3..0000000 --- a/pro/10_sites_ok.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/10_sites_ok.json.tt2 \ No newline at end of file diff --git a/pro/10_sites_ok.yaml.tt2 b/pro/10_sites_ok.yaml.tt2 new file mode 120000 index 0000000..f3280da --- /dev/null +++ b/pro/10_sites_ok.yaml.tt2 @@ -0,0 +1 @@ +../ce/10_sites_ok.yaml.tt2 \ No newline at end of file diff --git a/pro/99_dummy.json.tt2 b/pro/99_dummy.json.tt2 deleted file mode 120000 index f87caca..0000000 --- a/pro/99_dummy.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/99_dummy.json.tt2 \ No newline at end of file diff --git a/pro/99_dummy.yaml.tt2 b/pro/99_dummy.yaml.tt2 new file mode 120000 index 0000000..93817df --- /dev/null +++ b/pro/99_dummy.yaml.tt2 @@ -0,0 +1 @@ +../ce/99_dummy.yaml.tt2 \ No newline at end of file diff --git a/pro/goss.json.tt2 b/pro/goss.json.tt2 deleted file mode 120000 index ceda75e..0000000 --- a/pro/goss.json.tt2 +++ /dev/null @@ -1 +0,0 @@ -../ce/goss.json.tt2 \ No newline at end of file diff --git a/pro/goss.yaml.tt2 b/pro/goss.yaml.tt2 new file mode 120000 index 0000000..4995a35 --- /dev/null +++ b/pro/goss.yaml.tt2 @@ -0,0 +1 @@ +../ce/goss.yaml.tt2 \ No newline at end of file diff --git a/testrunner b/testrunner index 1b282c5..4788b2a 100755 --- a/testrunner +++ b/testrunner @@ -20,7 +20,7 @@ case "${TYPE}" in *) echo "ERRRO: Unknown type '$1'" >&2 ; usage >&2 ; exit 1 ;; esac -goss="goss-mika-git804995a8_with_tap_and_junit" +goss="goss-0.2.3-linux-amd64" if [ ! -x "/usr/sbin/${goss}" ] ; then echo "Downloading goss and installing as /usr/sbin/${goss}" @@ -54,7 +54,7 @@ mkdir -p "${REPORT_DIRECTORY}" TAP_RESULTS="${REPORT_DIRECTORY}/goss_${TYPE}_results.tap" # TODO: add --format=tap when TAP formater will be supported -if goss -g "/etc/ngcp-tests/${TYPE}/goss.json" validate ; then +if goss -g "/etc/ngcp-tests/${TYPE}/goss.yaml" validate ; then echo "1..1" > "${TAP_RESULTS}" echo "ok 1 - no errors were found" >> "${TAP_RESULTS}" else