Exemplo n.º 1
0
    def test_install_crontab(self):
        """install_crontab creates a crontab file"""
        root_dir = Path(self.fakes.fs.root.path)
        (root_dir / 'etc/cron.d').mkdir(parents=True)
        paths = get_paths(root_dir=root_dir)
        install_crontab(paths=paths)

        with paths['cron'].open() as fh:
            content = fh.read()

        script = paths['bin'] / 'mirror-archive'
        self.assertIn(str(script), content)
Exemplo n.º 2
0
def install_cron():
    cron.install_crontab()
    set_state(charm_state('job.enabled'))
Exemplo n.º 3
0
 def test_remove_crontab(self):
     """remove_crontab removes the crontab file."""
     install_crontab(paths=self.paths)
     remove_crontab(paths=self.paths)
     self.assertFalse(self.paths['cron'].exists())
def install_cron():
    cron.install_crontab()
    set_flag(charm_flag('job.enabled'))