Skip to content
Snippets Groups Projects
Commit c9ead0f8 authored by calvinosanch's avatar calvinosanch
Browse files

Make option for test functionality added to tool to upgrade vnf,ns descriptors to R. THREE


Signed-off-by: default avatargcalvino <guillermo.calvinosanchez@altran.com>
parent c11f6a46
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,9 @@
# limitations under the License.
#
TOPDIR=$(shell readlink -f .|sed -e 's/\/descriptor-packages\/.*//')
TOOLS_DIR := $(TOPDIR)/tools
SUBDIRS_CLEAN = $(addsuffix .clean, $(SUBDIRS))
.PHONY: $(SUBDIRS) $(SUBDIRS_CLEAN) clean
......@@ -27,3 +30,6 @@ $(SUBDIRS_CLEAN): %.clean:
$(SUBDIRS):
@$(MAKE) --no-print-directory -C $@
test:
$(TOOLS_DIR)/launch_tests.sh
#!/usr/bin/env bash
function test_format
{
folder=$(dir -1)
for file in $folder;
do
if [ -n $file ]; then
if [ -d "$file" ]; then
cd $file
test_format
cd ..
else
extension=${file##*.}
name=${file%.*}
folder_file=`pwd`
if [ $extension == "yaml" ]; then
$tools_dir/upgrade_descriptor_version.py --test -i $folder_file"/"$name.$extension -o $folder_file"/"$name."output" 2> $folder_file"/"$name."error"
[ -s $folder_file"/"$name."output" ] || rm $folder_file"/"$name."output"
[ -s $folder_file"/"$name."error" ] || rm $folder_file"/"$name."error"
fi;
fi;
fi;
done;
}
top_dir=`readlink -f .|sed -e 's/\/descriptor-packages\/.*//'`
tools_dir=${top_dir}/tools
if [ -f $tools_dir/upgrade_descriptor_version.py ]; then
cd ${top_dir}/
test_format ./
else
print "Error: 'make' command should be called inside '/devops/descriptor-packages/' folder to work"
exit -1
fi;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment