[ONOS-7346] ver.d

Change-Id: I757b2cb0089bfda73ac7206178fdce41c2a84e95
diff --git a/jjb/OnosSystemTest/cho-clean-up.sh b/jjb/OnosSystemTest/cho-clean-up.sh
index 9d2a1d0..f466d10 100644
--- a/jjb/OnosSystemTest/cho-clean-up.sh
+++ b/jjb/OnosSystemTest/cho-clean-up.sh
@@ -2,11 +2,11 @@
 
 source ./clean-up.sh
 
-beforeClean
+{beforeClean}
 
-cdTolog admin
+cd /home/admin/OnosSystemTest/TestON/logs
 
-cleaning
+{cleaning}
 
 cd /var/lib/jenkins/workspace/OnosProdCHOpost
 
@@ -18,4 +18,4 @@
 rm -rf $i
 done
 
-afterClean
+{afterClean}
diff --git a/jjb/OnosSystemTest/onos-test-freestyle.yaml b/jjb/OnosSystemTest/onos-test-freestyle.yaml
index f3029f2..726f803 100644
--- a/jjb/OnosSystemTest/onos-test-freestyle.yaml
+++ b/jjb/OnosSystemTest/onos-test-freestyle.yaml
@@ -31,6 +31,29 @@
                           echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property
          override-build-parameters: true
 
+- builder:
+    name: clean-up-bash
+    beforeClean: |
+                  echo -e "\n Before clean up disk usage: \n"
+                  df -h
+    cleaning: |
+               cleaning{
+               if [ $? -eq 0 ]
+               then
+                   echo "Checking if there are logs older than ${DAYS_OLD} days...."
+                   for i in $(find . -mtime +${DAYS_OLD} -type d)
+                   do
+                   echo -e "DIRs older than $DAYS_OLD are: "
+                   echo $i
+                   rm -rf $i
+                   done
+               fi
+    afterClean: |
+                 echo -e "\n After clean up disk usage:\n"
+                 df -h
+    builders:
+      - shell: '{cleanFileName}'
+
 # post_Job
 - job-template:
     name: postjob-{station-type}
@@ -92,7 +115,8 @@
 
     builders:
 
-      - shell: !include-raw-escape: vm-bm-clean-up.sh
+      - clean-up-bash:
+        cleanFileName: 'vm-bm-clean-up.sh'
 
 - job-template:
     name: test-station-log-cleanup-BM
@@ -123,7 +147,8 @@
 
     builders:
 
-      - shell: !include-raw-escape: vm-bm-clean-up.sh
+      - clean-up-bash:
+        cleanFileName: 'vm-bm-clean-up.sh'
 
 - job-template:
     name: test-station-log-cleanup-CHO
@@ -154,7 +179,8 @@
 
     builders:
 
-      - shell: !include-raw-escape: cho-clean-up.sh
+      - clean-up-bash:
+        cleanFileName: 'cho-clean-up.sh'
 
 # haven't done this yet.
 - job-template:
@@ -183,10 +209,6 @@
 #    triggers:
 #      - timed: '@daily'
 
-    builders:
-
-      - shell: !include-raw-escape: cho-clean-up.sh
-
 - job-template:
     name: delta-nightly
 
@@ -279,3 +301,13 @@
     <<: *test-free-init-procedure-plate
     jobs:
       - 'delta-nightly'
+
+#- project:
+#    name: cho-tests
+#    project-name: cho-tests
+#
+#    <<: *test-free-init-procedure-plate
+#    jobs:
+#      - 'init-CHO'
+#      - 'running-CHO'
+#      - 'post-CHO-master'
diff --git a/jjb/OnosSystemTest/vm-bm-clean-up.sh b/jjb/OnosSystemTest/vm-bm-clean-up.sh
index 03497fc..d5567c0 100644
--- a/jjb/OnosSystemTest/vm-bm-clean-up.sh
+++ b/jjb/OnosSystemTest/vm-bm-clean-up.sh
@@ -2,10 +2,10 @@
 
 source ./clean-up.sh
 
-beforeClean
+{beforeClean}
 
-cdTolog sdn
+cd /home/sdn/OnosSystemTest/TestON/logs
 
-cleaning
+{cleaning}
 
-afterClean
+{afterClean}