mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
Overhaul additional sanity tests. (#36803)
* Remove unnecessary sys.exit calls. * Add files filtering for code-smell tests. * Enhance test-constraints code-smell test. * Simplify compile sanity test. * Pass paths to importer on stdin. * Pass paths to yamllinter on stdin. * Add work-around for unicode path filtering. * Enhance configure-remoting-ps1 code-smell test. * Enhance integration-aliases code-smell test. * Enhance azure-requirements code-smell test. * Enhance no-illegal-filenames code-smell test.
This commit is contained in:
parent
5b5a79917d
commit
ac1698099d
23 changed files with 153 additions and 208 deletions
31
test/sanity/code-smell/configure-remoting-ps1.py
Executable file
31
test/sanity/code-smell/configure-remoting-ps1.py
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
# required by external automated processes and should not be moved, renamed or converted to a symbolic link
|
||||
path = 'examples/scripts/ConfigureRemotingForAnsible.ps1'
|
||||
directory = path
|
||||
|
||||
while True:
|
||||
directory = os.path.dirname(directory)
|
||||
|
||||
if not directory:
|
||||
break
|
||||
|
||||
if not os.path.isdir(directory):
|
||||
print('%s: must be a directory' % directory)
|
||||
|
||||
if os.path.islink(directory):
|
||||
print('%s: cannot be a symbolic link' % directory)
|
||||
|
||||
if not os.path.isfile(path):
|
||||
print('%s: must be a file' % path)
|
||||
|
||||
if os.path.islink(path):
|
||||
print('%s: cannot be a symbolic link' % path)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue