GoogleContainerTools / container-structure-test

validate the structure of your container images
Apache License 2.0
2.33k stars 200 forks source link

Feature request: Regex in file existence permissions tests/'should be executable' test #63

Closed Evesy closed 6 years ago

Evesy commented 6 years ago

Hi,

Having come from using Serverspec/Inspec I am missing not having a test directive similar to be_executable (https://www.inspec.io/docs/reference/resources/file/).

In often cases I am not ultimately concerned about exact file permissions on certain binaries within a container, but just that they are executable by user/group/other. Due to environment differences file permissions between local dev environments & ci environments are frequently different (i.e. due to different umask settings).

In these cases I care in the tests that the files are still executable (as this permission is tracked in github), and not about rw permissions.

I think supporting wildcard matching in the permissions string (i.e. -rwx**x**x), or adding an additional field to the fileExistance struct that can be used to just check for executable bits would be beneficial.

Cheers, Mike

nkubala commented 6 years ago

Hey Mike, thanks for reporting. Seems like a reasonable request. I think adding an isExecutable field or something similar is probably a little more clear than using wildcards in the permissions string.

Evesy commented 6 years ago

An isExecutable field would definitely be my preference over wildcard permissions too 👍

Evesy commented 6 years ago

Closed by #161