summaryrefslogtreecommitdiff
path: root/reconfigure/tests/configs
diff options
context:
space:
mode:
Diffstat (limited to 'reconfigure/tests/configs')
-rw-r--r--reconfigure/tests/configs/__init__.py0
-rw-r--r--reconfigure/tests/configs/ajenti_tests.py52
-rw-r--r--reconfigure/tests/configs/base_test.py37
-rw-r--r--reconfigure/tests/configs/bind9_tests.py28
-rw-r--r--reconfigure/tests/configs/crontab_tests.py53
-rw-r--r--reconfigure/tests/configs/ctdb_tests.py73
-rw-r--r--reconfigure/tests/configs/dhcpd_tests.py50
-rw-r--r--reconfigure/tests/configs/exports_tests.py45
-rw-r--r--reconfigure/tests/configs/fstab_tests.py34
-rw-r--r--reconfigure/tests/configs/group_tests.py30
-rw-r--r--reconfigure/tests/configs/hosts_tests.py40
-rw-r--r--reconfigure/tests/configs/iptables_tests.py100
-rw-r--r--reconfigure/tests/configs/netatalk_tests.py41
-rw-r--r--reconfigure/tests/configs/nsd_tests.py26
-rw-r--r--reconfigure/tests/configs/passwd_tests.py36
-rw-r--r--reconfigure/tests/configs/resolv_tests.py31
-rw-r--r--reconfigure/tests/configs/samba_tests.py70
-rw-r--r--reconfigure/tests/configs/squid_tests.py63
-rw-r--r--reconfigure/tests/configs/supervisor_tests.py36
19 files changed, 845 insertions, 0 deletions
diff --git a/reconfigure/tests/configs/__init__.py b/reconfigure/tests/configs/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/reconfigure/tests/configs/__init__.py
diff --git a/reconfigure/tests/configs/ajenti_tests.py b/reconfigure/tests/configs/ajenti_tests.py
new file mode 100644
index 0000000..56a1dc1
--- /dev/null
+++ b/reconfigure/tests/configs/ajenti_tests.py
@@ -0,0 +1,52 @@
+import json
+
+from reconfigure.configs import AjentiConfig
+from base_test import BaseConfigTest
+
+
+class AjentiConfigTest (BaseConfigTest):
+ sources = {
+ None: """{
+ "authentication": false,
+ "bind": {
+ "host": "0.0.0.0",
+ "port": 8000
+ },
+ "enable_feedback": true,
+ "installation_id": null,
+ "users": {
+ "test": {
+ "configs": { "a": "{}" },
+ "password": "sha512",
+ "permissions": [
+ "section:Dash"
+ ]
+ }
+ },
+ "ssl": {
+ "enable": false,
+ "certificate_path": ""
+ }
+}
+"""
+ }
+ result = {
+ 'authentication': False,
+ 'enable_feedback': True,
+ 'installation_id': None,
+ 'http_binding': {'host': '0.0.0.0', 'port': 8000},
+ 'ssl': {'certificate_path': '', 'enable': False},
+ 'users': {'test': {
+ 'configs': {'a': {'data': {}, 'name': 'a'}},
+ 'name': 'test',
+ 'password': 'sha512',
+ 'permissions': ['section:Dash']
+ }}
+ }
+
+ config = AjentiConfig
+
+ stringify_filter = staticmethod(json.loads)
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/base_test.py b/reconfigure/tests/configs/base_test.py
new file mode 100644
index 0000000..1824819
--- /dev/null
+++ b/reconfigure/tests/configs/base_test.py
@@ -0,0 +1,37 @@
+import unittest
+import json
+
+
+class BaseConfigTest (unittest.TestCase):
+ sources = ""
+ result = None
+ config = None
+ config_kwargs = {}
+ stringify_filter = staticmethod(lambda x: x.split())
+
+ def test_config(self):
+ if not self.config:
+ return
+
+ self.maxDiff = None
+
+ config = self.config(content=self.sources[None], **self.config_kwargs)
+ if config.includer:
+ config.includer.content_map = self.sources
+ config.load()
+ #print 'RESULT', config.tree.to_dict()
+ #print 'SOURCE', self.__class__.result
+ #self.assertTrue(self.__class__.result== config.tree.to_dict())
+ a, b = self.__class__.result, config.tree.to_dict()
+ if a != b:
+ print 'SOURCE: %s\nGENERATED: %s\n' % (json.dumps(a, indent=4), json.dumps(b, indent=4))
+ self.assertEquals(a, b)
+
+ result = config.save()
+ s_filter = self.__class__.stringify_filter
+ #print s_filter(result[None])
+ for k, v in result.iteritems():
+ self.assertEquals(
+ s_filter(self.__class__.sources[k]),
+ s_filter(v)
+ )
diff --git a/reconfigure/tests/configs/bind9_tests.py b/reconfigure/tests/configs/bind9_tests.py
new file mode 100644
index 0000000..ee0c05a
--- /dev/null
+++ b/reconfigure/tests/configs/bind9_tests.py
@@ -0,0 +1,28 @@
+from reconfigure.configs import BIND9Config
+from base_test import BaseConfigTest
+
+
+class BIND9ConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+zone "asd" {
+ type master;
+ file "/file";
+};
+
+"""
+ }
+ result = {
+ "zones": [
+ {
+ "type": "master",
+ "name": "asd",
+ "file": "/file"
+ }
+ ]
+ }
+
+ config = BIND9Config
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/crontab_tests.py b/reconfigure/tests/configs/crontab_tests.py
new file mode 100644
index 0000000..f1b28fe
--- /dev/null
+++ b/reconfigure/tests/configs/crontab_tests.py
@@ -0,0 +1,53 @@
+from reconfigure.configs import CrontabConfig
+from base_test import BaseConfigTest
+
+
+class CrontabConfigTest (BaseConfigTest):
+ sources = {
+ None: """#comment line
+* * * * * date
+@reboot ls -al
+1 * 0 1 2 date -s
+NAME = TEST"""
+ }
+ result = {
+ 'normal_tasks': [
+ {
+ 'minute': '*',
+ 'hour': '*',
+ 'day_of_month': '*',
+ 'month': '*',
+ 'day_of_week': '*',
+ 'command': 'date',
+ 'comment': 'comment line'
+ },
+ {
+ 'minute': '1',
+ 'hour': '*',
+ 'day_of_month': '0',
+ 'month': '1',
+ 'day_of_week': '2',
+ 'command': 'date -s',
+ 'comment': None,
+ },
+
+ ],
+ 'special_tasks': [
+ {
+ 'special': '@reboot',
+ 'command': 'ls -al',
+ 'comment': None,
+ }
+ ],
+ 'env_settings': [
+ {
+ 'name': 'NAME',
+ 'value': 'TEST',
+ 'comment': None
+ }
+ ]
+ }
+ config = CrontabConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/ctdb_tests.py b/reconfigure/tests/configs/ctdb_tests.py
new file mode 100644
index 0000000..7437ef7
--- /dev/null
+++ b/reconfigure/tests/configs/ctdb_tests.py
@@ -0,0 +1,73 @@
+from reconfigure.configs import CTDBConfig, CTDBNodesConfig, CTDBPublicAddressesConfig
+from base_test import BaseConfigTest
+
+
+class CTDBNodesConfigTest (BaseConfigTest):
+ sources = {
+ None: """10.10.1.1
+10.10.1.2
+"""
+ }
+ result = {
+ 'nodes': [
+ {
+ 'address': '10.10.1.1',
+ },
+ {
+ 'address': '10.10.1.2',
+ },
+ ]
+ }
+ config = CTDBNodesConfig
+
+
+class CTDBPublicAddressesConfigTest (BaseConfigTest):
+ sources = {
+ None: """10.10.1.1 eth0
+10.10.1.2 eth1
+"""
+ }
+ result = {
+ 'addresses': [
+ {
+ 'address': '10.10.1.1',
+ 'interface': 'eth0',
+ },
+ {
+ 'address': '10.10.1.2',
+ 'interface': 'eth1',
+ },
+ ]
+ }
+ config = CTDBPublicAddressesConfig
+
+
+class CTDBConfigTest (BaseConfigTest):
+ sources = {
+ None: """CTDB_RECOVERY_LOCK="/dadoscluster/ctdb/storage"
+CTDB_PUBLIC_INTERFACE=eth0
+CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
+CTDB_MANAGES_SAMBA=yes
+CTDB_NODES=/etc/ctdb/nodes
+CTDB_LOGFILE=/var/log/log.ctdb
+CTDB_DEBUGLEVEL=2
+CTDB_PUBLIC_NETWORK="10.0.0.0/24"
+CTDB_PUBLIC_GATEWAY="10.0.0.9"
+"""
+ }
+ result = {
+ "recovery_lock_file": "\"/dadoscluster/ctdb/storage\"",
+ "public_interface": "eth0",
+ "public_addresses_file": "/etc/ctdb/public_addresses",
+ "nodes_file": "/etc/ctdb/nodes",
+ "debug_level": "2",
+ "public_gateway": "\"10.0.0.9\"",
+ "public_network": "\"10.0.0.0/24\"",
+ "log_file": "/var/log/log.ctdb",
+ "manages_samba": True
+ }
+
+ config = CTDBConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/dhcpd_tests.py b/reconfigure/tests/configs/dhcpd_tests.py
new file mode 100644
index 0000000..73fbc74
--- /dev/null
+++ b/reconfigure/tests/configs/dhcpd_tests.py
@@ -0,0 +1,50 @@
+from reconfigure.configs import DHCPDConfig
+from base_test import BaseConfigTest
+
+
+class DHCPDConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+default-lease-time 600;
+max-lease-time 7200;
+
+ subnet 10.17.224.0 netmask 255.255.255.0 {
+ option routers rtr-224.example.org;
+ range 10.0.29.10 10.0.29.230;
+ }
+shared-network 224-29 {
+ subnet 10.17.224.0 netmask 255.255.255.0 {
+ option routers rtr-224.example.org;
+ }
+ pool {
+ deny members of "foo";
+ range 10.0.29.10 10.0.29.230;
+ }
+}
+
+"""
+ }
+ result = {
+ "subnets": [
+ {
+ "ranges": [
+ {
+ "range": "10.0.29.10 10.0.29.230"
+ }
+ ],
+ "subnets": [],
+ "name": "10.17.224.0 netmask 255.255.255.0",
+ "options": [
+ {
+ "value": "routers rtr-224.example.org"
+ }
+ ]
+ }
+ ],
+ "options": []
+ }
+
+ config = DHCPDConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/exports_tests.py b/reconfigure/tests/configs/exports_tests.py
new file mode 100644
index 0000000..be85736
--- /dev/null
+++ b/reconfigure/tests/configs/exports_tests.py
@@ -0,0 +1,45 @@
+from reconfigure.configs import ExportsConfig
+from base_test import BaseConfigTest
+
+
+class ExportsConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+/another/exported/directory 192.168.0.3(rw,sync) \
+192.168.0.4(ro) # test
+/one 192.168.0.1 # comment
+"""
+ }
+ result = {
+ "exports": [
+ {
+ "comment": "test",
+ "name": '/another/exported/directory',
+ "clients": [
+ {
+ "name": "192.168.0.3",
+ "options": "rw,sync"
+ },
+ {
+ "name": "192.168.0.4",
+ "options": "ro"
+ }
+ ]
+ },
+ {
+ "comment": "comment",
+ "name": '/one',
+ "clients": [
+ {
+ "name": "192.168.0.1",
+ "options": ""
+ }
+ ]
+ }
+ ]
+ }
+
+ config = ExportsConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/fstab_tests.py b/reconfigure/tests/configs/fstab_tests.py
new file mode 100644
index 0000000..9ffe19b
--- /dev/null
+++ b/reconfigure/tests/configs/fstab_tests.py
@@ -0,0 +1,34 @@
+from reconfigure.configs import FSTabConfig
+from base_test import BaseConfigTest
+
+
+class FSTabConfigTest (BaseConfigTest):
+ sources = {
+ None: """fs1\tmp1\text\trw\t1\t2
+fs2\tmp2\tauto\tnone\t0\t0
+"""
+ }
+ result = {
+ 'filesystems': [
+ {
+ 'device': 'fs1',
+ 'mountpoint': 'mp1',
+ 'type': 'ext',
+ 'options': 'rw',
+ 'freq': '1',
+ 'passno': '2'
+ },
+ {
+ 'device': 'fs2',
+ 'mountpoint': 'mp2',
+ 'type': 'auto',
+ 'options': 'none',
+ 'freq': '0',
+ 'passno': '0'
+ },
+ ]
+ }
+ config = FSTabConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/group_tests.py b/reconfigure/tests/configs/group_tests.py
new file mode 100644
index 0000000..b53dc5c
--- /dev/null
+++ b/reconfigure/tests/configs/group_tests.py
@@ -0,0 +1,30 @@
+from reconfigure.configs import GroupConfig
+from base_test import BaseConfigTest
+
+
+class GroupConfigTest (BaseConfigTest):
+ sources = {
+ None: """sys:x:3:
+adm:x:4:eugeny
+"""
+ }
+ result = {
+ 'groups': [
+ {
+ 'name': 'sys',
+ 'password': 'x',
+ 'gid': '3',
+ 'users': '',
+ },
+ {
+ 'name': 'adm',
+ 'password': 'x',
+ 'gid': '4',
+ 'users': 'eugeny',
+ },
+ ]
+ }
+ config = GroupConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/hosts_tests.py b/reconfigure/tests/configs/hosts_tests.py
new file mode 100644
index 0000000..e202929
--- /dev/null
+++ b/reconfigure/tests/configs/hosts_tests.py
@@ -0,0 +1,40 @@
+from reconfigure.configs import HostsConfig
+from base_test import BaseConfigTest
+
+
+class FSTabConfigTest (BaseConfigTest):
+ sources = {
+ None: """a1 h1 a2 a3 a4
+a5 h2
+a6 h3 a7
+"""
+ }
+ result = {
+ 'hosts': [
+ {
+ 'address': 'a1',
+ 'name': 'h1',
+ 'aliases': [
+ {'name': 'a2'},
+ {'name': 'a3'},
+ {'name': 'a4'},
+ ]
+ },
+ {
+ 'address': 'a5',
+ 'aliases': [],
+ 'name': 'h2',
+ },
+ {
+ 'address': 'a6',
+ 'name': 'h3',
+ 'aliases': [
+ {'name': 'a7'},
+ ]
+ },
+ ]
+ }
+ config = HostsConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/iptables_tests.py b/reconfigure/tests/configs/iptables_tests.py
new file mode 100644
index 0000000..335e081
--- /dev/null
+++ b/reconfigure/tests/configs/iptables_tests.py
@@ -0,0 +1,100 @@
+from reconfigure.configs import IPTablesConfig
+from base_test import BaseConfigTest
+
+
+class IPTablesConfigTest (BaseConfigTest):
+ sources = {
+ None: '''*filter
+:INPUT ACCEPT [0:0]
+:FORWARD DROP [0:0]
+:OUTPUT ACCEPT [0:0]
+-A INPUT ! -s 202.54.1.2/32 -j DROP
+-A INPUT -m state --state NEW,ESTABLISHED -j ACCEPT # test
+COMMIT
+'''
+ }
+ result = {
+ 'tables': [
+ {
+ 'chains': [
+ {
+ 'default': 'ACCEPT',
+ 'rules': [
+ {
+ 'options': [
+ {
+ 'arguments': [
+ {
+ 'value': '202.54.1.2/32'
+ }
+ ],
+ 'negative': True,
+ 'name': 's'
+ },
+ {
+ 'arguments': [
+ {
+ 'value': 'DROP'
+ }
+ ],
+ 'negative': False,
+ 'name': 'j'
+ }
+ ],
+ 'comment': None,
+ },
+ {
+ 'options': [
+ {
+ 'arguments': [
+ {
+ 'value': 'state'
+ }
+ ],
+ 'negative': False,
+ 'name': 'm'
+ },
+ {
+ 'arguments': [
+ {
+ 'value': 'NEW,ESTABLISHED'
+ }
+ ],
+ 'negative': False,
+ 'name': 'state'
+ },
+ {
+ 'arguments': [
+ {
+ 'value': 'ACCEPT'
+ }
+ ],
+ 'negative': False,
+ 'name': 'j'
+ }
+ ],
+ 'comment': 'test',
+ }
+ ],
+ 'name': 'INPUT'
+ },
+ {
+ 'default': 'DROP',
+ 'rules': [],
+ 'name': 'FORWARD'
+ },
+ {
+ 'default': 'ACCEPT',
+ 'rules': [],
+ 'name': 'OUTPUT'
+ }
+ ],
+ 'name': 'filter'
+ }
+ ]
+ }
+
+ config = IPTablesConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/netatalk_tests.py b/reconfigure/tests/configs/netatalk_tests.py
new file mode 100644
index 0000000..ab9f693
--- /dev/null
+++ b/reconfigure/tests/configs/netatalk_tests.py
@@ -0,0 +1,41 @@
+from reconfigure.configs import NetatalkConfig
+from base_test import BaseConfigTest
+
+
+class NetatalkConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+[Global]
+afp port=123
+
+[test]
+path=/home ;comment
+valid users=root
+ea=sys
+"""
+ }
+
+ result = {
+ "global": {
+ "zeroconf": True,
+ "cnid_listen": "localhost:4700",
+ "afp_port": "123",
+ },
+ "shares": [
+ {
+ "comment": "comment",
+ "appledouble": "ea",
+ "name": "test",
+ "ea": "sys",
+ "valid_users": "root",
+ "cnid_scheme": "dbd",
+ "path": "/home",
+ "password": '',
+ }
+ ]
+ }
+
+ config = NetatalkConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/nsd_tests.py b/reconfigure/tests/configs/nsd_tests.py
new file mode 100644
index 0000000..d91b0bd
--- /dev/null
+++ b/reconfigure/tests/configs/nsd_tests.py
@@ -0,0 +1,26 @@
+from reconfigure.configs import NSDConfig
+from base_test import BaseConfigTest
+
+
+class NSDConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+zone:
+ name: "example.net"
+ zonefile: "example.net.signed.zone"
+ notify-retry: 5
+"""
+ }
+ result = {
+ "zones": [
+ {
+ "name": "example.net",
+ "file": "example.net.signed.zone"
+ }
+ ]
+ }
+
+ config = NSDConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/passwd_tests.py b/reconfigure/tests/configs/passwd_tests.py
new file mode 100644
index 0000000..8f9a5de
--- /dev/null
+++ b/reconfigure/tests/configs/passwd_tests.py
@@ -0,0 +1,36 @@
+from reconfigure.configs import PasswdConfig
+from base_test import BaseConfigTest
+
+
+class PasswdConfigTest (BaseConfigTest):
+ sources = {
+ None: """backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+"""
+ }
+ result = {
+ 'users': [
+ {
+ 'name': 'backup',
+ 'password': 'x',
+ 'uid': '34',
+ 'gid': '34',
+ 'comment': 'backup',
+ 'home': '/var/backups',
+ 'shell': '/bin/sh'
+ },
+ {
+ 'name': 'list',
+ 'password': 'x',
+ 'uid': '38',
+ 'gid': '38',
+ 'comment': 'Mailing List Manager',
+ 'home': '/var/list',
+ 'shell': '/bin/sh'
+ },
+ ]
+ }
+ config = PasswdConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/resolv_tests.py b/reconfigure/tests/configs/resolv_tests.py
new file mode 100644
index 0000000..d7bedc8
--- /dev/null
+++ b/reconfigure/tests/configs/resolv_tests.py
@@ -0,0 +1,31 @@
+from reconfigure.configs import ResolvConfig
+from base_test import BaseConfigTest
+
+
+class ResolvConfigTest (BaseConfigTest):
+ sources = {
+ None: """nameserver 1
+domain 2
+search 3 5
+"""
+ }
+ result = {
+ 'items': [
+ {
+ 'name': 'nameserver',
+ 'value': '1',
+ },
+ {
+ 'name': 'domain',
+ 'value': '2',
+ },
+ {
+ 'name': 'search',
+ 'value': '3 5',
+ },
+ ]
+ }
+ config = ResolvConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/samba_tests.py b/reconfigure/tests/configs/samba_tests.py
new file mode 100644
index 0000000..c6ce44c
--- /dev/null
+++ b/reconfigure/tests/configs/samba_tests.py
@@ -0,0 +1,70 @@
+from reconfigure.configs import SambaConfig
+from base_test import BaseConfigTest
+
+
+class SambaConfigTest (BaseConfigTest):
+ sources = {
+ None: """
+[global]
+workgroup=WORKGROUP
+server string=%h server (Samba, Ubuntu)
+interfaces=127.0.0.0/8 eth0
+bind interfaces only=yes
+log file=/var/log/samba/log.%m
+security=user
+
+[homes]
+comment=Home Directories
+browseable=no
+
+[profiles]
+comment=Users profiles
+path=/home/samba/profiles
+guest ok=no
+browseable=no
+create mask=0600
+directory mask=0700
+"""
+ }
+
+ result = {
+ "global": {
+ "server_string": "%h server (Samba, Ubuntu)",
+ "workgroup": "WORKGROUP",
+ "interfaces": "127.0.0.0/8 eth0",
+ "bind_interfaces_only": True,
+ "security": "user",
+ "log_file": "/var/log/samba/log.%m"
+ },
+ "shares": [
+ {
+ "name": "homes",
+ "comment": "Home Directories",
+ "browseable": False,
+ "create_mask": "0744",
+ "directory_mask": "0755",
+ 'follow_symlinks': True,
+ "read_only": True,
+ "guest_ok": False,
+ "path": "",
+ 'wide_links': False,
+ },
+ {
+ "name": "profiles",
+ "comment": "Users profiles",
+ "browseable": False,
+ "create_mask": "0600",
+ "directory_mask": "0700",
+ 'follow_symlinks': True,
+ "read_only": True,
+ "guest_ok": False,
+ "path": "/home/samba/profiles",
+ 'wide_links': False
+ }
+ ]
+ }
+
+ config = SambaConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/squid_tests.py b/reconfigure/tests/configs/squid_tests.py
new file mode 100644
index 0000000..011d4bf
--- /dev/null
+++ b/reconfigure/tests/configs/squid_tests.py
@@ -0,0 +1,63 @@
+from reconfigure.configs import SquidConfig
+from base_test import BaseConfigTest
+
+
+class SquidConfigTest (BaseConfigTest):
+ sources = {
+ None: """acl manager proto cache_object
+acl SSL_ports port 443
+http_access deny CONNECT !SSL_ports
+http_port 3128
+"""
+ }
+ result = {
+ "http_access": [
+ {
+ "mode": "deny",
+ "options": [
+ {
+ "value": "CONNECT"
+ },
+ {
+ "value": "!SSL_ports"
+ }
+ ]
+ }
+ ],
+ "http_port": [
+ {
+ "options": [],
+ "port": "3128"
+ }
+ ],
+ "https_port": [],
+ "acl": [
+ {
+ "name": "manager",
+ "options": [
+ {
+ "value": "proto"
+ },
+ {
+ "value": "cache_object"
+ }
+ ]
+ },
+ {
+ "name": "SSL_ports",
+ "options": [
+ {
+ "value": "port"
+ },
+ {
+ "value": "443"
+ }
+ ]
+ }
+ ]
+ }
+
+ config = SquidConfig
+
+
+del BaseConfigTest
diff --git a/reconfigure/tests/configs/supervisor_tests.py b/reconfigure/tests/configs/supervisor_tests.py
new file mode 100644
index 0000000..8656128
--- /dev/null
+++ b/reconfigure/tests/configs/supervisor_tests.py
@@ -0,0 +1,36 @@
+from reconfigure.configs import SupervisorConfig
+from base_test import BaseConfigTest
+
+
+class SupervisorConfigTest (BaseConfigTest):
+ sources = {
+ None: """[unix_http_server]
+file=/var/run//supervisor.sock ;comment
+chmod=0700
+[include]
+files=test""",
+ 'test': """[program:test1]
+command=cat
+ """
+ }
+ result = {
+ "programs": [
+ {
+ "autorestart": None,
+ "name": "test1",
+ "startsecs": None,
+ "umask": None,
+ "environment": None,
+ "command": "cat",
+ "user": None,
+ "startretries": None,
+ "directory": None,
+ "autostart": None
+ }
+ ]
+ }
+
+ config = SupervisorConfig
+
+
+del BaseConfigTest