use group's basename on test descriptors
In cases where test_groups contains forward slashes, i.e. absolute
paths, only the basename directory should be considered when creating
the test description, otherwise file creation fails as seen below:
$ test_groups=/home/lsandov1/repos/TF-A/tf-a-ci-scripts/group/tf-l1-build-fvp workspace=$PWD/ws script/gen_test_desc.py
Traceback (most recent call last):
File "script/gen_test_desc.py", line 127, in <module>
process_item(item)
File "script/gen_test_desc.py", line 90, in process_item
gen_desc(item, a_file)
File "script/gen_test_desc.py", line 64, in gen_desc
with open(desc, "wt") as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/home/lsandov1/repos/TF-A/tf-a-ci-scripts/ws/000%/home/lsandov1/repos/TF-A/tf-a-ci-scripts/group/tf-l1-build-fvp%fvp-rddaniel-tbb,nil,nil,nil:nil.test'
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: I781e17f2c3ae672669ecdf2252983891e4e8e4af
diff --git a/script/gen_test_desc.py b/script/gen_test_desc.py
index d729a9f..e5334e4 100755
--- a/script/gen_test_desc.py
+++ b/script/gen_test_desc.py
@@ -59,7 +59,7 @@
# Create descriptor. Write the name of the original test config as its
# content.
- desc = os.path.join(workspace, "%".join([str(num_spawn).zfill(3), group,
+ desc = os.path.join(workspace, "%".join([str(num_spawn).zfill(3), os.path.basename(group),
test_config + TEST_SUFFIX]))
with open(desc, "wt") as fd:
print(test, file=fd)