summaryrefslogtreecommitdiff
path: root/reconfigure/tests/configs/crontab_tests.py
blob: f1b28feae13a984c80d64f23ff1349088831e163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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