Add versioning, test Jenkinsfile, and license headers
Change-Id: I4d4664946b715f53f1f528d1740c0854ef154d48
diff --git a/Jenkinsfile.test b/Jenkinsfile.test
new file mode 100644
index 0000000..275fb35
--- /dev/null
+++ b/Jenkinsfile.test
@@ -0,0 +1,43 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+node ('openolt_deb_onf_agent') {
+ timeout (time: 240) {
+ try {
+ dir ('openolt') {
+ stage ('Pull latest code') {
+ sh returnStdout: true, script: 'git pull'
+ }
+ stage ('Copy over SDK, BAL, patch files and DEB generators') {
+ sh returnStdout: true, script: 'cp ../../build-files/SW-BCM68620_2_4_3_6.zip download'
+ sh returnStdout: true, script: 'cp ../../build-files/sdk-all-6.5.7.tar.gz download'
+ sh returnStdout: true, script: 'cp ../../build-files/ACCTON_BAL_2.4.3.6-V201710131639.patch download'
+ sh returnStdout: true, script: 'cp ../../build-files/OPENOLT_BAL_2.4.3.6.patch download'
+ }
+ stage ('Build packages and libraries') {
+ sh returnStdout: true, script: '/bin/bash -c ./configure && make DEVICE=asfvolt16'
+ }
+ stage ('Create Debian file') {
+ sh returnStdout: true, script: '/bin/bash -c "make DEVICE=asfvolt16 deb"'
+ }
+ }
+ currentBuild.result = 'SUCCESS'
+ } catch (err) {
+ currentBuild.result = 'FAILURE'
+ step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
+ } finally {
+ echo "RESULT: ${currentBuild.result}"
+ }
+ }
+}
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..059dbff
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0.0-dev0
diff --git a/common/state.h b/common/state.h
index b19280f..3573c4b 100644
--- a/common/state.h
+++ b/common/state.h
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#ifndef OPENOLT_STATE_H_
#define OPENOLT_STATE_H_
diff --git a/mkdebian/build_asfvolt16_deb.sh b/mkdebian/build_asfvolt16_deb.sh
index 6c60959..b42cdf7 100755
--- a/mkdebian/build_asfvolt16_deb.sh
+++ b/mkdebian/build_asfvolt16_deb.sh
@@ -1,3 +1,19 @@
#!/bin/bash
+
+# Copyright 2018-present Open Networking Foundation
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
export ONL_ARCH="amd64"
dpkg-buildpackage -b -us -uc -a"$ONL_ARCH"
diff --git a/mkdebian/debian/asfvolt16.postinst b/mkdebian/debian/asfvolt16.postinst
index e7d5a53..f2709c5 100644
--- a/mkdebian/debian/asfvolt16.postinst
+++ b/mkdebian/debian/asfvolt16.postinst
@@ -1,5 +1,20 @@
#!/bin/bash
+# Copyright 2018-present Open Networking Foundation
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
rm -rf /opt/bcm68620
rm -rf /broadcom
tar zxf /tmp/release_asfvolt16_V02.06.201804301043.tar.gz -C / 2>&1 > /dev/null
diff --git a/mkdebian/debian/asfvolt16.postrm b/mkdebian/debian/asfvolt16.postrm
index f5dc1d5..e99a65a 100644
--- a/mkdebian/debian/asfvolt16.postrm
+++ b/mkdebian/debian/asfvolt16.postrm
@@ -1,5 +1,20 @@
#!/bin/bash
+# Copyright 2018-present Open Networking Foundation
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
rm -rf /opt/bcm68620
rm -rf /broadcom
sed -i '\/opt\/bcm68620\/svk_init.sh/d' /etc/rc.local
diff --git a/mkdebian/debian/asfvolt16.preinst b/mkdebian/debian/asfvolt16.preinst
index 047e7fe..1237c87 100644
--- a/mkdebian/debian/asfvolt16.preinst
+++ b/mkdebian/debian/asfvolt16.preinst
@@ -1,5 +1,20 @@
#!/bin/bash
+# Copyright 2018-present Open Networking Foundation
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
# kill CLI applications
echo "kill running time application"
[ -n "`pidof bcm_user_appl`" ] && killall bcm_user_appl
@@ -7,7 +22,7 @@
[ -n "`pidof voltha_bal_driver`" ] && killall voltha_bal_driver
# service bal_core_dist stop
# service openolt stop
-[ -n "`pidof bal_core_dist`" ] && killall bal_core_dist
+[ -n "`pidof bal_core_dist`" ] && killall bal_core_dist
rm -f /var/run/bal_core_dist.pid
[ -n "`pidof openolt`" ] && killall openolt
rm -f /var/run/openolt.pid
diff --git a/src/error_format.cc b/src/error_format.cc
index 1bc361f..53588e4 100644
--- a/src/error_format.cc
+++ b/src/error_format.cc
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "error_format.h"
using grpc::Status;
using grpc::StatusCode;
diff --git a/src/error_format.h b/src/error_format.h
index 9fea079..9736456 100644
--- a/src/error_format.h
+++ b/src/error_format.h
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#ifndef OPENOLT_ERROR_FORMAT_H_
#define OPENOLT_ERROR_FORMAT_H_
diff --git a/src/stats_collection.cc b/src/stats_collection.cc
index e988d44..82a178f 100644
--- a/src/stats_collection.cc
+++ b/src/stats_collection.cc
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "stats_collection.h"
#include <unistd.h>
diff --git a/src/stats_collection.h b/src/stats_collection.h
index 09b70f1..743d0be 100644
--- a/src/stats_collection.h
+++ b/src/stats_collection.h
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#ifndef OPENOLT_STATS_COLLECTION_H_
#define OPENOLT_STATS_COLLECTION_H_
diff --git a/src/translation.cc b/src/translation.cc
index c2343b8..cc963ac 100644
--- a/src/translation.cc
+++ b/src/translation.cc
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include "translation.h"
int interface_key_to_port_no(bcmbal_interface_key key) {
diff --git a/src/translation.h b/src/translation.h
index ffd476d..285eaf1 100644
--- a/src/translation.h
+++ b/src/translation.h
@@ -1,3 +1,20 @@
+/*
+ Copyright (C) 2018 Open Networking Foundation
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#ifndef OPENOLT_TRANSLATION_H_
#define OPENOLT_TRANSLATION_H_