osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38530?usp=email )


Change subject: testenv: osmo-dev: add hint for gen_makefile fail
......................................................................

testenv: osmo-dev: add hint for gen_makefile fail

When gen_makefile.py from osmo-dev fails, it is likely that the osmo-dev
git clone is outdated, for example if a new file with configure options
was added to osmo-dev.git and is now being used by testenv. Display a
hint for pulling this repository to the user.

Change-Id: Ia9ed23fa910876252093054f5f389865632c7593
---
M _testenv/testenv/osmo_dev.py
M _testenv/testenv/podman.py
2 files changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/30/38530/1

diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py
index 4dd581a..9a10462 100644
--- a/_testenv/testenv/osmo_dev.py
+++ b/_testenv/testenv/osmo_dev.py
@@ -2,6 +2,7 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 import logging
 import os
+import shlex
 import sys
 import testenv
 import testenv.cmd
@@ -92,7 +93,12 @@
         os.path.join(testenv.data_dir, "osmo-dev/osmo-bts-trx.opts"),
     ] + extra_opts

-    testenv.cmd.run(cmd, cwd=get_osmo_dev_dir())
+    cwd = get_osmo_dev_dir()
+    if testenv.cmd.run(cmd, cwd=cwd, check=False).returncode:
+        logging.critical("gen_makefile.py from osmo-dev failed!")
+        logging.critical("Your osmo-dev.git clone might be outdated, try:")
+        logging.critical(f"$ git -C {shlex.quote(cwd)} pull")
+        sys.exit(1)
     init_done = True


diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index 683f468..faa1837 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -146,7 +146,7 @@
     if isinstance(cmd, str):
         cmd = ["sh", "-c", cmd]

-    testenv.cmd.run(
+    return testenv.cmd.run(
         ["podman", "exec"] + podman_opts + [container_name] + cmd,
         no_podman=True,
         *args,

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38530?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia9ed23fa910876252093054f5f389865632c7593
Gerrit-Change-Number: 38530
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to