<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17710">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Introduce contrib/jenkins-build-amarisoft.sh<br><br>Prepares inst tgz archives to be consumed by osmo-gsm-tester from<br>Amarisoft prebuilt binaries.<br><br>Change-Id: I372606fc5ff9f6bb3ef848f2fe229b83382ddc09<br>---<br>A contrib/jenkins-build-amarisoft.sh<br>M src/osmo_gsm_tester/amarisoft_enb.py<br>M src/osmo_gsm_tester/amarisoft_epc.py<br>3 files changed, 75 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/contrib/jenkins-build-amarisoft.sh b/contrib/jenkins-build-amarisoft.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..ee26f45</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/jenkins-build-amarisoft.sh</span><br><span>@@ -0,0 +1,69 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh</span><br><span style="color: hsl(120, 100%, 40%);">+set -e -x</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+amarisoft_tgz="$1"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if [ ! -f "$amarisoft_tgz" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+        echo "Amarisoft tgz doesn't exist: $amarisoft_tgz"</span><br><span style="color: hsl(120, 100%, 40%);">+        exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+base="$PWD"</span><br><span style="color: hsl(120, 100%, 40%);">+name="srslte"</span><br><span style="color: hsl(120, 100%, 40%);">+git_url="${git_url:-https://github.com/srsLTE}"</span><br><span style="color: hsl(120, 100%, 40%);">+project_name_srslte="${project_name:-srsLTE}"</span><br><span style="color: hsl(120, 100%, 40%);">+. "$(dirname "$0")/jenkins-build-common.sh"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#TODO: make sure libconfig, zeroMQ is installed</span><br><span style="color: hsl(120, 100%, 40%);">+build_repo $project_name_srslte</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+git_url="git@github.com:softwareradiosystems"</span><br><span style="color: hsl(120, 100%, 40%);">+project_name_zmq="amarisoft_dummy_trx"</span><br><span style="color: hsl(120, 100%, 40%);">+branch="trx_zmq"</span><br><span style="color: hsl(120, 100%, 40%);">+have_repo $project_name_zmq $branch</span><br><span style="color: hsl(120, 100%, 40%);">+cd $project_name_zmq</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf build && mkdir build && cd build || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+cmake -DSRSLTE_BUILD_PATH=${base}/${project_name_srslte}/build ../</span><br><span style="color: hsl(120, 100%, 40%);">+make -j8</span><br><span style="color: hsl(120, 100%, 40%);">+cd $base</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf inst-tmp && mkdir inst-tmp</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf inst-tmp-uhd && mkdir inst-tmp-uhd</span><br><span style="color: hsl(120, 100%, 40%);">+tar -zxf $amarisoft_tgz -C inst-tmp/</span><br><span style="color: hsl(120, 100%, 40%);">+tar -zxf inst-tmp/*/trx_uhd*.tar.gz -C inst-tmp/</span><br><span style="color: hsl(120, 100%, 40%);">+#tar -zxf inst-tmp/trx_uhd-linux*/trx_uhd.so.tar.gz -C inst-tmp-uhd/</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Build trx_uhd.so:</span><br><span style="color: hsl(120, 100%, 40%);">+cd ${base}/inst-tmp/trx_uhd-linux*/</span><br><span style="color: hsl(120, 100%, 40%);">+make</span><br><span style="color: hsl(120, 100%, 40%);">+cd ${base}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Create amarisoftenb inst:</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf inst-amarisoftenb && mkdir inst-amarisoftenb || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+tar --strip-components=1 -zxf inst-tmp/*/lteenb-linux*.tar.gz -C inst-amarisoftenb/</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/${project_name_srslte}/build/lib/src/phy/rf/libsrslte_rf.so inst-amarisoftenb/</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/${project_name_zmq}/build/libtrx_zmq-linux-2018-10-18.so inst-amarisoftenb/trx_zmq.so</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/inst-tmp/trx_uhd-linux*/trx_uhd.so inst-amarisoftenb/</span><br><span style="color: hsl(120, 100%, 40%);">+this="amarisoftenb.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"</span><br><span style="color: hsl(120, 100%, 40%);">+tar="${this}.tgz"</span><br><span style="color: hsl(120, 100%, 40%);">+tar -czf "$tar" -C inst-amarisoftenb/ .</span><br><span style="color: hsl(120, 100%, 40%);">+md5sum "$tar" > "${this}.md5"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Create amarisoftue inst:</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf inst-amarisoftue && mkdir inst-amarisoftue || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+tar --strip-components=1 -zxf inst-tmp/*/lteue-linux*.tar.gz -C inst-amarisoftue/</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/${project_name_srslte}/build/lib/src/phy/rf/libsrslte_rf.so inst-amarisoftue/</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/${project_name_zmq}/build/libtrx_zmq-linux-2018-10-18.so inst-amarisoftue/trx_zmq.so</span><br><span style="color: hsl(120, 100%, 40%);">+cp ${base}/inst-tmp/trx_uhd-linux*/trx_uhd.so inst-amarisoftenb/</span><br><span style="color: hsl(120, 100%, 40%);">+this="amarisoftue.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"</span><br><span style="color: hsl(120, 100%, 40%);">+tar="${this}.tgz"</span><br><span style="color: hsl(120, 100%, 40%);">+tar -czf "$tar" -C inst-amarisoftue/ .</span><br><span style="color: hsl(120, 100%, 40%);">+md5sum "$tar" > "${this}.md5"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Create amarisoftepc inst:</span><br><span style="color: hsl(120, 100%, 40%);">+rm -rf inst-amarisoftepc && mkdir inst-amarisoftepc || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+tar --strip-components=1 -zxf inst-tmp/*/ltemme-linux*.tar.gz -C inst-amarisoftepc/</span><br><span style="color: hsl(120, 100%, 40%);">+this="amarisoftepc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"</span><br><span style="color: hsl(120, 100%, 40%);">+tar="${this}.tgz"</span><br><span style="color: hsl(120, 100%, 40%);">+tar -czf "$tar" -C inst-amarisoftepc/ .</span><br><span style="color: hsl(120, 100%, 40%);">+md5sum "$tar" > "${this}.md5"</span><br><span>diff --git a/src/osmo_gsm_tester/amarisoft_enb.py b/src/osmo_gsm_tester/amarisoft_enb.py</span><br><span>index 79b90a7..5b4e99e 100644</span><br><span>--- a/src/osmo_gsm_tester/amarisoft_enb.py</span><br><span>+++ b/src/osmo_gsm_tester/amarisoft_enb.py</span><br><span>@@ -82,7 +82,9 @@</span><br><span> </span><br><span>     def bin_prefix(self):</span><br><span>         if self._bin_prefix is None:</span><br><span style="color: hsl(0, 100%, 40%);">-            self._bin_prefix = os.getenv('AMARISOFT_PATH_ENB', AmarisoftENB.REMOTE_DIR)</span><br><span style="color: hsl(120, 100%, 40%);">+            self._bin_prefix = os.getenv('AMARISOFT_PATH_ENB', None)</span><br><span style="color: hsl(120, 100%, 40%);">+            if self._bin_prefix == None:</span><br><span style="color: hsl(120, 100%, 40%);">+                self._bin_prefix  = self.suite_run.trial.get_inst('amarisoftenb')</span><br><span>         return self._bin_prefix</span><br><span> </span><br><span>     def cleanup(self):</span><br><span>diff --git a/src/osmo_gsm_tester/amarisoft_epc.py b/src/osmo_gsm_tester/amarisoft_epc.py</span><br><span>index eb9be94..c1f341c 100644</span><br><span>--- a/src/osmo_gsm_tester/amarisoft_epc.py</span><br><span>+++ b/src/osmo_gsm_tester/amarisoft_epc.py</span><br><span>@@ -56,7 +56,9 @@</span><br><span> </span><br><span>     def bin_prefix(self):</span><br><span>         if self._bin_prefix is None:</span><br><span style="color: hsl(0, 100%, 40%);">-            self._bin_prefix = os.getenv('AMARISOFT_PATH_EPC', AmarisoftEPC.REMOTE_DIR)</span><br><span style="color: hsl(120, 100%, 40%);">+            self._bin_prefix = os.getenv('AMARISOFT_PATH_EPC', None)</span><br><span style="color: hsl(120, 100%, 40%);">+            if self._bin_prefix == None:</span><br><span style="color: hsl(120, 100%, 40%);">+                self._bin_prefix  = self.suite_run.trial.get_inst('amarisoftepc')</span><br><span>         return self._bin_prefix</span><br><span> </span><br><span>     def cleanup(self):</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17710">change 17710</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17710"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I372606fc5ff9f6bb3ef848f2fe229b83382ddc09 </div>
<div style="display:none"> Gerrit-Change-Number: 17710 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>