2019-02-18 15:46:32 +00:00
|
|
|
"""
|
|
|
|
Checks that no implementation makes use of symbolic links.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import pqclean
|
2019-04-10 22:03:02 +01:00
|
|
|
import helpers
|
2019-03-01 12:18:41 +00:00
|
|
|
|
2019-02-18 15:46:32 +00:00
|
|
|
|
|
|
|
def test_no_symlinks():
|
|
|
|
for scheme in pqclean.Scheme.all_schemes():
|
|
|
|
for implementation in scheme.implementations:
|
2019-04-18 09:00:08 +01:00
|
|
|
yield check_no_symlinks, implementation
|
2019-02-18 15:46:32 +00:00
|
|
|
|
|
|
|
|
2019-04-18 09:00:08 +01:00
|
|
|
@helpers.filtered_test
|
2019-03-01 12:18:41 +00:00
|
|
|
def check_no_symlinks(implementation):
|
2019-02-18 15:46:32 +00:00
|
|
|
for file in os.listdir(implementation.path()):
|
|
|
|
fpath = os.path.join(implementation.path(), file)
|
|
|
|
if os.path.islink(fpath):
|
|
|
|
raise AssertionError("{} is a symbolic link!".format(fpath))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
try:
|
|
|
|
import nose2
|
|
|
|
nose2.main()
|
|
|
|
except ImportError:
|
|
|
|
import nose
|
|
|
|
nose.runmodule()
|