better systemd service support
This commit is contained in:
14
tests/dictionaries/70service_engine/00-base.xml
Normal file
14
tests/dictionaries/70service_engine/00-base.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<services>
|
||||
<service name="testsrv" engine="creole">
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general" description="général">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
0
tests/dictionaries/70service_engine/__init__.py
Normal file
0
tests/dictionaries/70service_engine/__init__.py
Normal file
14
tests/dictionaries/70service_engine/makedict/after.json
Normal file
14
tests/dictionaries/70service_engine/makedict/after.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
5
tests/dictionaries/70service_engine/makedict/base.json
Normal file
5
tests/dictionaries/70service_engine/makedict/base.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": "oui",
|
||||
"services.testsrv.activate": true,
|
||||
"services.testsrv.manage": true
|
||||
}
|
14
tests/dictionaries/70service_engine/makedict/before.json
Normal file
14
tests/dictionaries/70service_engine/makedict/before.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
oui
|
22
tests/dictionaries/70service_engine/tiramisu/base.py
Normal file
22
tests/dictionaries/70service_engine/tiramisu/base.py
Normal file
@ -0,0 +1,22 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||
option_7 = BoolOption(name="manage", doc="manage", default=True)
|
||||
option_5 = OptionDescription(name="testsrv", doc="testsrv", children=[option_6, option_7])
|
||||
option_5.impl_set_information('engine', "creole")
|
||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
1
tests/dictionaries/70service_engine/tmpl/testsrv.service
Normal file
1
tests/dictionaries/70service_engine/tmpl/testsrv.service
Normal file
@ -0,0 +1 @@
|
||||
%%mode_conteneur_actif
|
13
tests/dictionaries/70service_mount/00-base.xml
Normal file
13
tests/dictionaries/70service_mount/00-base.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<services>
|
||||
<service name="testsrv" type="mount" engine="creole"/>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general" description="général">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
0
tests/dictionaries/70service_mount/__init__.py
Normal file
0
tests/dictionaries/70service_mount/__init__.py
Normal file
14
tests/dictionaries/70service_mount/makedict/after.json
Normal file
14
tests/dictionaries/70service_mount/makedict/after.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
5
tests/dictionaries/70service_mount/makedict/base.json
Normal file
5
tests/dictionaries/70service_mount/makedict/base.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": "oui",
|
||||
"services.testsrv.activate": true,
|
||||
"services.testsrv.manage": true
|
||||
}
|
14
tests/dictionaries/70service_mount/makedict/before.json
Normal file
14
tests/dictionaries/70service_mount/makedict/before.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
oui
|
23
tests/dictionaries/70service_mount/tiramisu/base.py
Normal file
23
tests/dictionaries/70service_mount/tiramisu/base.py
Normal file
@ -0,0 +1,23 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||
option_7 = BoolOption(name="manage", doc="manage", default=True)
|
||||
option_5 = OptionDescription(name="testsrv", doc="testsrv", children=[option_6, option_7])
|
||||
option_5.impl_set_information('type', "mount")
|
||||
option_5.impl_set_information('engine', "creole")
|
||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
1
tests/dictionaries/70service_mount/tmpl/testsrv.mount
Normal file
1
tests/dictionaries/70service_mount/tmpl/testsrv.mount
Normal file
@ -0,0 +1 @@
|
||||
%%mode_conteneur_actif
|
13
tests/dictionaries/70service_target/00-base.xml
Normal file
13
tests/dictionaries/70service_target/00-base.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<services>
|
||||
<service name="testsrv" target="test"/>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general" description="général">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
0
tests/dictionaries/70service_target/__init__.py
Normal file
0
tests/dictionaries/70service_target/__init__.py
Normal file
14
tests/dictionaries/70service_target/makedict/after.json
Normal file
14
tests/dictionaries/70service_target/makedict/after.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
5
tests/dictionaries/70service_target/makedict/base.json
Normal file
5
tests/dictionaries/70service_target/makedict/base.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": "oui",
|
||||
"services.testsrv.activate": true,
|
||||
"services.testsrv.manage": true
|
||||
}
|
14
tests/dictionaries/70service_target/makedict/before.json
Normal file
14
tests/dictionaries/70service_target/makedict/before.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
/usr/lib/systemd/system/testsrv.service
|
22
tests/dictionaries/70service_target/tiramisu/base.py
Normal file
22
tests/dictionaries/70service_target/tiramisu/base.py
Normal file
@ -0,0 +1,22 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||
option_7 = BoolOption(name="manage", doc="manage", default=True)
|
||||
option_5 = OptionDescription(name="testsrv", doc="testsrv", children=[option_6, option_7])
|
||||
option_5.impl_set_information('target', "test")
|
||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
13
tests/dictionaries/70service_target_engine/00-base.xml
Normal file
13
tests/dictionaries/70service_target_engine/00-base.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<services>
|
||||
<service name="testsrv" target="test" engine="none"/>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general" description="général">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": "oui",
|
||||
"services.testsrv.activate": true,
|
||||
"services.testsrv.manage": true
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"rougail.general.mode_conteneur_actif": {
|
||||
"owner": "default",
|
||||
"value": "oui"
|
||||
},
|
||||
"services.testsrv.activate": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
},
|
||||
"services.testsrv.manage": {
|
||||
"owner": "default",
|
||||
"value": true
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
/usr/local/lib/systemd/system/testsrv.service
|
@ -0,0 +1 @@
|
||||
%%mode_conteneur_actif
|
23
tests/dictionaries/70service_target_engine/tiramisu/base.py
Normal file
23
tests/dictionaries/70service_target_engine/tiramisu/base.py
Normal file
@ -0,0 +1,23 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
|
||||
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_6 = BoolOption(name="activate", doc="activate", default=True)
|
||||
option_7 = BoolOption(name="manage", doc="manage", default=True)
|
||||
option_5 = OptionDescription(name="testsrv", doc="testsrv", children=[option_6, option_7])
|
||||
option_5.impl_set_information('target', "test")
|
||||
option_5.impl_set_information('engine', "none")
|
||||
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])
|
@ -0,0 +1 @@
|
||||
%%mode_conteneur_actif
|
6
tests/dictionaries/80wrong_service_name/00-base.xml
Normal file
6
tests/dictionaries/80wrong_service_name/00-base.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail version="0.10">
|
||||
<services>
|
||||
<service name="testsrv.mount"/>
|
||||
</services>
|
||||
</rougail>
|
0
tests/dictionaries/80wrong_service_name/__init__.py
Normal file
0
tests/dictionaries/80wrong_service_name/__init__.py
Normal file
0
tests/dictionaries/80wrong_service_name/errno_76
Normal file
0
tests/dictionaries/80wrong_service_name/errno_76
Normal file
@ -1,4 +1,4 @@
|
||||
from os import listdir, mkdir
|
||||
from os import listdir, mkdir, readlink
|
||||
from os.path import join, isdir, isfile, islink
|
||||
from shutil import rmtree
|
||||
from pytest import fixture, mark
|
||||
@ -82,7 +82,9 @@ async def test_dictionary(test_dir):
|
||||
assert list_templates == list_results
|
||||
for result in list_results:
|
||||
template_file = join(dest_dir, result)
|
||||
if islink(template_file) and islink(join(test_dir, 'result', result)):
|
||||
assert islink(template_file) == islink(join(test_dir, 'result', result))
|
||||
if islink(template_file):
|
||||
assert readlink(template_file) == readlink(join(test_dir, 'result', result))
|
||||
continue
|
||||
if not isfile(template_file):
|
||||
raise Exception(f'{template_file} is not generated')
|
||||
|
Reference in New Issue
Block a user