Revert "Remove obsolete ovn4nfv jjbs"
[releng.git] / jjb / ovn4nfv / golang-make-test.sh
diff --git a/jjb/ovn4nfv/golang-make-test.sh b/jjb/ovn4nfv/golang-make-test.sh
new file mode 100644 (file)
index 0000000..7ed4632
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 Intel Corporation.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -o errexit
+set -o pipefail
+
+source /etc/os-release || source /usr/lib/os-release
+case ${ID,,} in
+    ubuntu|debian)
+    sudo add-apt-repository -y ppa:longsleep/golang-backports
+    sudo apt-get update
+    sudo apt-get install -y build-essential golang-go
+    sudo apt-get -y clean && sudo apt-get -y autoremove
+    ;;
+esac
+
+echo "Running unit tests in Go ${golang_version} ..."
+cd $WORKSPACE
+make test