cron: add extensions
https://www.man7.org/linux/man-pages/man5/crontab.5.html#EXTENSIONS
This commit is contained in:
@@ -337,6 +337,9 @@ describe('Apps', function () {
|
||||
|
||||
safe(() => apps._parseCrontab('*/1 * * *\t* ')); // no command
|
||||
expect(safe.error.message).to.be('Invalid cron configuration at line 1');
|
||||
|
||||
safe(() => apps._parseCrontab('@whatever /bin/false')); // invalid extension
|
||||
expect(safe.error.message).to.be('Unknown extension pattern at line 1');
|
||||
});
|
||||
|
||||
it('succeeds for crontab', function () {
|
||||
@@ -353,5 +356,16 @@ describe('Apps', function () {
|
||||
expect(result[1].command).to.be('echo "==> This is a custom cron task running every hour"');
|
||||
|
||||
});
|
||||
|
||||
it('succeeds for crontab (extensions)', function () {
|
||||
const result = apps._parseCrontab('@reboot /bin/reboot\n\n@weekly /bin/weekly');
|
||||
expect(result.length).to.be(2);
|
||||
|
||||
expect(result[0].schedule).to.be('@reboot');
|
||||
expect(result[0].command).to.be('/bin/reboot');
|
||||
|
||||
expect(result[1].schedule).to.be('0 0 * * 0');
|
||||
expect(result[1].command).to.be('/bin/weekly');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user