Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.12]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand All @@ -24,7 +24,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install missing aexpect dependency (remove when https://github.com/avocado-framework/aexpect/pull/81 is merged)
run: pip install six
run: pip install six numpy
- run: pip install -r requirements.txt
- run: make check

Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ifndef PYTHON
PYTHON=$(shell which python3 2>/dev/null || which python 2>/dev/null)
endif
PYTHON_DEVELOP_ARGS=$(shell if ($(PYTHON) setup.py develop --help 2>/dev/null | grep -q '\-\-user'); then echo "--user"; else echo ""; fi)

all:
@echo
Expand All @@ -26,12 +25,11 @@ coverage: clean develop
./selftests/run_coverage

develop:
$(PYTHON) setup.py develop $(PYTHON_DEVELOP_ARGS)
$(PYTHON) -m pip install -e .

clean:
$(PYTHON) setup.py clean
$(PYTHON) -m pip uninstall -y runperf
rm -rf build/ MANIFEST BUILD BUILDROOT SPECS RPMS SRPMS SOURCES dist/ docs/build/
$(PYTHON) setup.py develop --uninstall $(PYTHON_DEVELOP_ARGS)
rm -rf *.egg-info
find . -name '*.pyc' -delete

Expand Down
4 changes: 2 additions & 2 deletions contrib/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
FROM fedora
MAINTAINER Lukas Doktor ldoktor@redhat.com

RUN dnf -y module enable avocado:latest && dnf install -y python3-pip git python3-pyyaml python3-numpy python3-aexpect python3-jinja2 rsync && dnf clean all
RUN python3 -m pip install git+https://github.com/distributed-system-analysis/run-perf.git
RUN dnf install -y python3-avocado python3-pip git python3-pyyaml python3-numpy python3-jinja2 rsync && dnf clean all
RUN python3 -m pip install git+https://github.com/distributed-system-analysis/run-perf.git git+https://github.com/avocado-framework/aexpect.git
RUN ssh-keygen -t ed25519 -N "" -f /root/.ssh/id_ed25519
RUN curl https://raw.githubusercontent.com/distributed-system-analysis/run-perf/master/contrib/bisect.sh > /usr/local/bin/bisect.sh && chmod +x /usr/local/bin/bisect.sh
RUN curl https://raw.githubusercontent.com/distributed-system-analysis/run-perf/master/contrib/upstream_qemu_bisect.sh > /usr/local/bin/upstream_qemu_bisect.sh && chmod +x /usr/local/bin/upstream_qemu_bisect.sh
Expand Down
4 changes: 2 additions & 2 deletions runperf/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

import json
import os
import pipes
import re
import shlex
import tempfile
import time

Expand Down Expand Up @@ -60,7 +60,7 @@ def _all_machines_kmsg(self, msg):
for worker in workers:
sessions.append(worker.get_session(hop=self.host))
msg = f"C{time.time():.0f}: {self.host.profile.name}: {msg}"
cmd = f"echo runperf: W$(date +%s): {pipes.quote(msg)} > /dev/kmsg"
cmd = f"echo runperf: W$(date +%s): {shlex.quote(msg)} > /dev/kmsg"
for session in sessions:
session.sendline(cmd)
for session in sessions:
Expand Down
10 changes: 5 additions & 5 deletions runperf/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import itertools
import logging
import os
import pipes
import random
import shlex
import shutil
import string
import subprocess # nosec
Expand Down Expand Up @@ -275,7 +275,7 @@ def check_output(*args, **kwargs):
args[0], str(args[1:]), str(kwargs))
else:
logging.debug("Running: %s (%s, %s)",
" ".join(pipes.quote(_) for _ in args[0]),
" ".join(shlex.quote(_) for _ in args[0]),
str(args[1:]), str(kwargs))
try:
return subprocess.check_output(*args, **kwargs).decode("utf-8") # nosec
Expand Down Expand Up @@ -458,7 +458,7 @@ def shell_write_content_cmd(path, content, append=False):
eof = random_string(6)
if eof + '\n' not in content:
break
return (f"cat {'>>' if append else '>'} {pipes.quote(path)} << "
return (f"cat {'>>' if append else '>'} {shlex.quote(path)} << "
f"\\{eof}\n{content}\n{eof}")


Expand All @@ -478,7 +478,7 @@ def _shell_write_content_cmd(path, content, append=False):
if eof + '\n' not in content:
break
return (f"head -c -1 <<\\{eof} | cat {'>>' if append else '>'} "
f"{pipes.quote(path)}\n{content}\n{eof}")
f"{shlex.quote(path)}\n{content}\n{eof}")
size = 4096
if len(content) < size:
return run(shell_write_content_cmd(path, content, append))
Expand Down Expand Up @@ -512,7 +512,7 @@ def shell_dnf_install_cmd(pkgs):
:param pkgs: List of pkg names to be installed
:return: Command to install all packages
"""
escaped_pkgs = [pipes.quote(_) for _ in pkgs]
escaped_pkgs = [shlex.quote(_) for _ in pkgs]
return f"dnf install -y --nobest --skip-broken {' '.join(escaped_pkgs)}"

def wait_for_machine_calms_down(session, timeout=600):
Expand Down
4 changes: 2 additions & 2 deletions runperf/utils/cloud_image_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# Copyright: Red Hat Inc. 2020
# Author: Lukas Doktor <ldoktor@redhat.com>
import os
import pipes
import re
import shlex
from urllib.request import urlopen

from runperf import utils
Expand Down Expand Up @@ -92,7 +92,7 @@ def prepare(self, default_password):
"""
# To be sure remove image and per-vm images as well
self.session.cmd("rm -f " +
' '.join(pipes.quote(_) for _ in self.paths))
' '.join(shlex.quote(_) for _ in self.paths))
# Store shared ssh key to allow checking for the same pub ssh key
# when reusing the image.
self.session.cmd(utils.shell_write_content_cmd(self.pubkey,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _get_git_version():
try:
subprocess.check_output([git, "diff", "--quiet"]) # nosec
except subprocess.CalledProcessError:
version += "+dirty"
version += ".dirty"
except (OSError, subprocess.SubprocessError, NameError):
return '0.0'
finally:
Expand Down
Loading