Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM ghcr.io/slaclab/smurf-rogue:R5.0.1

# Install Xvfb for virtual display support when running with GUI (-g)
RUN apt-get update && apt-get install -y --no-install-recommends \
xvfb \
x11-utils \
&& rm -rf /var/lib/apt/lists/*

# Copy all firmware related files, which are in the local_files directory
RUN mkdir -p /tmp/fw/ && chmod -R a+rw /tmp/fw/
COPY local_files /tmp/fw/
Expand Down
18 changes: 18 additions & 0 deletions docker/server/scripts/start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ args+=" ${extra_args}"

echo

# If the GUI flag (-g or --gui) is present, ensure a display is available.
# Start Xvfb if DISPLAY is not set or the X server is not reachable.
if echo "${args}" | grep -qE '(^|\s)(-g|--gui)(\s|$)'; then
if [ -z "${DISPLAY}" ] || ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; then
echo "No working display found. Starting Xvfb..."
Xvfb :0 -screen 0 1920x1080x24 &
export DISPLAY=:0
# Wait for Xvfb to be ready
for i in $(seq 1 10); do
if xdpyinfo -display :0 >/dev/null 2>&1; then
break
fi
sleep 0.5
done
echo "Xvfb started on display ${DISPLAY}"
fi
fi

# Call the appropriate server startup script depending on the communication type
# and pass the list of arguments 'args'.
if [ ${comm_type} == 'eth' ]; then
Expand Down
11 changes: 8 additions & 3 deletions tests/core/validate_base_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,19 @@ def __init__(self, **kwargs):
root.StreamDataSource.SourceEnable.set(False)
print('Done')

# Wait for the pipeline to drain: poll until the FileWriter
# has received at least as many frames as entered the pipeline.
print(' Waiting for pipeline to drain... ', end='')
rx_in = root.SmurfProcessor.FrameRxStats.FrameCnt.get()
while root.SmurfProcessor.FileWriter.FrameCount.get() < rx_in:
time.sleep(0.1)
print('Done')

# Close the output file
print(' Closing the FileWriter output file... ', end='')
root.SmurfProcessor.FileWriter.Close()
print('Done')

# Delay to make sure all counters are up-to-date
time.sleep(2)

# Read all the frame counters
print(' Reading counters... ', end='')
# FrameRxStats
Expand Down