2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

tests: verify executable flag for plugins with shebang

This commit is contained in:
Lars Kruse 2018-03-08 23:33:33 +01:00
parent 29e6f53cad
commit ebe5be1d06

View File

@ -48,7 +48,14 @@ sub process_file {
my ( $file, $filename, $interpreter, $arguments ) = @_; my ( $file, $filename, $interpreter, $arguments ) = @_;
use v5.10.1; use v5.10.1;
if ( $interpreter =~ m{/bin/sh} ) { if ( ! -x $file ) {
# missing executable flag
diag(
sprintf("\nFile '%s' lacks executable permission bits. Maybe try 'chmod +x $file'?\n",
$file)
);
}
elsif ( $interpreter =~ m{/bin/sh} ) {
subtest $filename => sub { subtest $filename => sub {
plan tests => 2; plan tests => 2;
run_check( run_check(