Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8731183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:10:24+00:00 2026-06-13T09:10:24+00:00

I am writing a python script that is used for continuous integration and test

  • 0

I am writing a python script that is used for continuous integration and test that will be called by bitten. Our unit tests use the google test framework. Each software component has a bash script that runs configuration and other required services and runs the gtest executable. The python script walks the repository looking for the bash scripts, and calls each script using the os.popen() command.

Python script (UnitTest.py)

#!/usr/bin/python

import os
import fnmatch
import sys
import subprocess

repository_location = '/home/actuv/workspace/eclipse/iccs/'
unit_test_script_name = 'RunUnitTests.sh'

def file_locator(repo, script_name):
    # Function for determining all unit test scripts
    test_location = []
    for root, dirnames, filenames in os.walk(repo):
        for filename in fnmatch.filter(filenames, script_name):
            test_location.append(os.path.join(root))
    return test_location

def run_tests(test_locations, script_name):
    # Runs test scripts located at each test location
    for tests in test_locations:
        cmd = 'cd ' + tests + ';./' + script_name
        print 'Running Unit Test at: ' + tests
        os.popen(cmd)

################    MAIN    ################
# Find Test Locations
script_locations = file_locator(repository_location, unit_test_script_name)

# Run tests located at each location
run_tests(script_locations)

# End of tests
sys.exit(0)

Bash Script

#!/bin/sh

echo "Running unit tests..."

# update the LD_LIBRARY_PATH to include paths to our shared libraries

# start the test server

# Run the tests

# wait to allow all processes to end before terminating the server
sleep 10s

When I run the bash script manually from a terminal window, it runs fine. When I have the python script call the bash script I get a segmentation fault on the TestSingleClient and TestMultiClientLA lines of the bash script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:10:26+00:00Added an answer on June 13, 2026 at 9:10 am

    Try replacing

    os.popen(cmd)
    

    with

    proc = subprocess.Popen('./scriptname', shell = True, 
                           cwd = tests)
    proc.communicate()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I amm writing a little python script that will grab information from VMs of
I'm writing a python CGI script that will query a MySQL database. I'm using
I'm writing a Python script that will automatically logon users from a list. This
I'm writing a python script that makes calls to adb to perform JUnit tests.
I'm writing some scripts that will be used by non-python users. I have a
I am writing a python script that will parse through a file quickly by
I'm writing a test for a Python script that returns a list of submitters.
First some background, I have a python script that will be called periodically by
I'm writing a Python script at work that contains a part with a large
I am writing a python command line script that takes a .ldif and two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.