tests/system/python/conftest.py
def reset_and_start_foglamp(storage_plugin):
    """Fixture that kills foglamp, reset database and starts foglamp again
        storage_plugin: Fixture that defines the storage plugin to be used for tests
    """

    assert os.environ.get('FOGLAMP_ROOT') is not None

    subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp kill"], shell=True, check=True)
    if storage_plugin == 'postgres':
        subprocess.run(["sed -i 's/sqlite/postgres/g' $FOGLAMP_ROOT/data/etc/storage.json"], shell=True, check=True)
    else:
        subprocess.run(["sed -i 's/postgres/sqlite/g' $FOGLAMP_ROOT/data/etc/storage.json"], shell=True, check=True)

    subprocess.run(["echo YES | $FOGLAMP_ROOT/scripts/foglamp reset"], shell=True, check=True)
    subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp start"], shell=True)
    stat = subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp status"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    assert "FogLAMP not running." not in stat.stderr.decode("utf-8")
Fixture that kills foglamp, reset database and starts foglamp again
        storage_plugin: Fixture that defines the storage plugin to be used for tests
    
Fixture that kills foglamp, reset database and starts foglamp again
storage_plugin: Fixture that defines the storage plugin to be used for tests
Fixture that kills foglamp reset database and starts foglamp again storage_plugin : Fixture that defines the storage plugin to be used for tests
def reset_and_start_foglamp(storage_plugin):
    assert os.environ.get('FOGLAMP_ROOT') is not None
    subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp kill"], shell=True, check=True)
    if storage_plugin == 'postgres':
        subprocess.run(["sed -i 's/sqlite/postgres/g' $FOGLAMP_ROOT/data/etc/storage.json"], shell=True, check=True)
    else:
        subprocess.run(["sed -i 's/postgres/sqlite/g' $FOGLAMP_ROOT/data/etc/storage.json"], shell=True, check=True)
    subprocess.run(["echo YES | $FOGLAMP_ROOT/scripts/foglamp reset"], shell=True, check=True)
    subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp start"], shell=True)
    stat = subprocess.run(["$FOGLAMP_ROOT/scripts/foglamp status"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    assert "FogLAMP not running." not in stat.stderr.decode("utf-8")
def reset_and_start_foglamp ( storage_plugin ) : assert os . environ . get ( 'FOGLAMP_ROOT' ) is not None subprocess . run ( [ "$FOGLAMP_ROOT/scripts/foglamp kill" ] , shell = True , check = True ) if storage_plugin == 'postgres' : subprocess . run ( [ "sed -i 's/sqlite/postgres/g' $FOGLAMP_ROOT/data/etc/storage.json" ] , shell = True , check = True ) else : subprocess . run ( [ "sed -i 's/postgres/sqlite/g' $FOGLAMP_ROOT/data/etc/storage.json" ] , shell = True , check = True ) subprocess . run ( [ "echo YES | $FOGLAMP_ROOT/scripts/foglamp reset" ] , shell = True , check = True ) subprocess . run ( [ "$FOGLAMP_ROOT/scripts/foglamp start" ] , shell = True ) stat = subprocess . run ( [ "$FOGLAMP_ROOT/scripts/foglamp status" ] , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) assert "FogLAMP not running." not in stat . stderr . decode ( "utf-8" )
Fixture that kills foglamp, reset database and starts foglamp again
storage_plugin: Fixture that defines the storage plugin to be used for tests
Fixture that kills foglamp reset database and starts foglamp again storage_plugin : Fixture that defines the storage plugin to be used for tests
"""Fixture that kills foglamp, reset database and starts foglamp again
        storage_plugin: Fixture that defines the storage plugin to be used for tests
    """
storage_plugin