summaryrefslogtreecommitdiff
path: root/test/rule-syntax-check.py
Commit message (Collapse)AuthorAgeFilesLines
* rule-syntax-check: add CONSTJan Synacek2019-10-181-1/+1
|
* rule-syntax-check: allow PROGRAM as an assignmentJan Synacek2019-02-101-1/+4
|
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-141-1/+1
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* rule-syntax-check: fix handling of runaway strings in comma splitting (#8298)Filipe Brandenburger2018-02-281-1/+3
| | | | | | | | | | | | | | | | A runaway string should still be returned by the code that splits on commas, so add a '?' to the regex so that the last '"?' in a string still produces a valid block for the split code. Tested: ACTION=="remove\"GOTO="" Which then produced: $ test/rule-syntax-check.py src/login/70-uaccess.rules # looking at src/login/70-uaccess.rules Invalid line src/login/70-uaccess.rules:10: ACTION=="remove\"GOTO="" clause: ACTION=="remove\"GOTO=""
* rule-syntax-check: allow commas inside quoted stringsFilipe Brandenburger2018-02-271-2/+4
| | | | | | | | | | | Using a regex to match the groups is smarter than the split(',') that would break in those cases. Tested: SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*,*:070202:*", TAG+="uaccess" Rule checker doesn't break there after this commit.
* rule-syntax-check: add support for escaped double quotesFilipe Brandenburger2018-02-271-4/+5
| | | | | | | | | | | | | | | Add support to backslash-escaped double quote inside a string. Tested by modifying src/login/70-uaccess.rules to include: ACTION=="remove" it", GOTO="uaccess_end" And had the rule checker complain about it: $ test/rule-syntax-check.py src/login/70-uaccess.rules # looking at src/login/70-uaccess.rules Invalid line src/login/70-uaccess.rules:10: ACTION=="remove" it", GOTO="uaccess_end" clause: ACTION=="remove" it"
* rule-syntax-check: values can contain escaped double quotesFranck Bui2018-02-271-4/+6
| | | | | | | | | This is true since commit 7e760b79ad143b26a5c937afa7666a7c40508f85. Note that the changes in the regex expressions relies on the fact that the script assumes that the comma separator is mandatory. Add a comment in the script to clarify this.
* rule-syntax-check: PROGRAM is not supposed to get value assignedFranck Bui2018-02-271-2/+2
| | | | | | | | | | | | | | In udev man page, "PROGRAM" key is part of the keys which are used for matching purposes so it should only be used with the compare operator "==". Actually it doesn't really make sense to assign it a value. udev code allows both "=" and "==" for PROGRAM and both are handled the same way but for consistencies it's better to have only the compare operator allowed by the rule syntax checker. No rules shipped by systemd use PROGRAM key so nothing need to be changed in our rule files.
* meson: re-attach rule-syntax-check.py testZbigniew Jędrzejewski-Szmek2017-11-221-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 39/248 rule-syntax-check OK 0.07 s --- command --- /home/zbyszek/src/systemd-work/test/rule-syntax-check.py \ /home/zbyszek/src/systemd-work/build/../rules/60-block.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-cdrom_id.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-drm.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-evdev.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-input-id.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-persistent-alsa.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-persistent-input.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-persistent-storage.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-persistent-storage-tape.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-persistent-v4l.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-sensor.rules \ /home/zbyszek/src/systemd-work/build/../rules/60-serial.rules \ /home/zbyszek/src/systemd-work/build/../rules/70-joystick.rules \ /home/zbyszek/src/systemd-work/build/../rules/70-mouse.rules \ /home/zbyszek/src/systemd-work/build/../rules/70-touchpad.rules \ /home/zbyszek/src/systemd-work/build/../rules/75-net-description.rules \ /home/zbyszek/src/systemd-work/build/../rules/75-probe_mtd.rules \ /home/zbyszek/src/systemd-work/build/../rules/78-sound-card.rules \ /home/zbyszek/src/systemd-work/build/../rules/80-drivers.rules \ /home/zbyszek/src/systemd-work/build/../rules/80-net-setup-link.rules \ /home/zbyszek/src/systemd-work/build/rules/50-udev-default.rules \ /home/zbyszek/src/systemd-work/build/rules/64-btrfs.rules \ /home/zbyszek/src/systemd-work/build/rules/99-systemd.rules --- stdout --- ... ------- It got dropped by mistake in 72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8.
* rule-test-syntax: modernize syntax and add debug messageZbigniew Jędrzejewski-Szmek2017-11-221-4/+5
|
* Add SPDX license headers to python scriptsZbigniew Jędrzejewski-Szmek2017-11-191-0/+2
|
* more portable python shebangs (#5816)Jörg Thalheim2017-04-301-1/+1
| | | | | This is useful on systems like NixOS, where python3 is not in /usr/bin/python3 as well as for people using alternative ways to install python such as virtualenv/pyenv.
* python: use raw strings for regexp patternsZbigniew Jędrzejewski-Szmek2016-12-011-4/+4
| | | | | Behaviour is not changed, because "unknown" escapes like \s or \d were not substituted, but it's much nicer to use raw strings to avoid ambiguity.
* Use python3 explicitly in all python scriptsFelipe Sateler2016-11-281-0/+1
|
* udev: remove WAIT_FOR keyKay Sievers2015-06-301-1/+1
| | | | | | This facility was never a proper solution, but only papered over real bugs in the kernel. There are no known sysfs "timing bugs" since a long time.
* test: simplify rules-test.sh wrapperMartin Pitt2015-01-201-4/+14
| | | | | | | | | Drop globbing of rules/*.rules in the rules-test.sh wrapper and move that logic into the actual test rule-syntax-check.py. This can still be called with individual rules files, but when being called without arguments it will now process all top_builddir/rules/*.rules. Preparation for dropping the shell wrappers altogether.
* test: Use configured PythonMartin Pitt2015-01-201-1/+0
| | | | Don't hardcode "python" or /usr/bin/python, but use the configured $(PYTHON).
* test/rule-syntax-check.py: Fix for Python 3Martin Pitt2015-01-201-3/+3
| | | | Make this work with both Python 2 and 3.
* test: add licence header and switch to LGPLKay Sievers2013-08-141-11/+10
| | | | Checked with and got OK from Martin.
* licence: remove references to old FSF addressSami Kerola2012-12-171-9/+9
| | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206
* udev: fix rule-syntax-check.pyKay Sievers2012-10-091-1/+1
|
* udev: test - move test/ and src/test/Kay Sievers2012-04-141-0/+64