Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address pre-commit reported issues #477

Merged
merged 1 commit into from
Jul 3, 2024
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
8 changes: 5 additions & 3 deletions build-aux/validations
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

# shellcheck source=/dev/null
source /etc/os-release

versionid=$(echo $VERSION_ID | awk -F. '{print $1}')
id_os=$(echo $ID | grep -i -E "(centos|rhel|autosd)")
versionid=$(echo "$VERSION_ID" | awk -F. '{print $1}')
id_os=$(echo "$ID" | grep -i -E "(centos|rhel|autosd)")

if [ "${versionid}" -le 9 ] && [ -n ${id_os} ] ; then
if [ "${versionid}" -le 9 ] && [ -n "${id_os}" ] ; then
# the sed command is required for the selinux
exit 0
fi
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/dashboard-tui/car-dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Dashboard(object):
if returncode != 0:
print(
"{cmd} return code {ret}".format(
cmd=cmd_str, ret=returncode
cmd=cmd_str, ret=returncode
)
)

Expand Down Expand Up @@ -316,7 +316,7 @@ class Dashboard(object):
]

self.execute_cmd(
cmd
cmd
)

def make_layout(self) -> Layout:
Expand Down Expand Up @@ -421,8 +421,8 @@ class Dashboard(object):
padding=(1, 2),
title="[b white] " + titleName,
border_style="bright_blue",
)
)
)
)

def bluechictl_action(
self,
Expand Down
3 changes: 0 additions & 3 deletions tests/e2e/set-ffi-env-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ EOF

install_autosd_repo() {
# Install autosd repository
source /etc/os-release

releasever=${VERSION_ID}
sandrobonazzola marked this conversation as resolved.
Show resolved Hide resolved
touch /etc/yum.repos.d/autosd.repo
cat > "/etc/yum.repos.d/autosd.repo" << EOF
[autosd]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <string.h>

int main() {
int pid = getpid();
int pid = getpid();
int policy = SCHED_FIFO; // Desired scheduling policy
struct sched_param param;

Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/tools/FFI/sysctl/setsysctl
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ generate_random_number() {
}

# Network tuning parameters
sysctl -w net.ipv4.ip_forward=$(generate_random_number 0 1)
sysctl -w net.ipv4.conf.all.rp_filter=$(generate_random_number 0 2)
sysctl -w net.ipv4.tcp_max_syn_backlog=$(generate_random_number 128 1024)
sysctl -w net.ipv4.ip_forward="$(generate_random_number 0 1)"
sysctl -w net.ipv4.conf.all.rp_filter="$(generate_random_number 0 2)"
sysctl -w net.ipv4.tcp_max_syn_backlog="$(generate_random_number 128 1024)"

# Buffer Sizes
if [ -f "/proc/sys/net/core/rmem_max" ]; then
sysctl -w net.core.rmem_max=$(generate_random_number 4096 16777216)
sysctl -w net.core.rmem_max="$(generate_random_number 4096 16777216)"
fi

if [ -f "/proc/sys/net/core/wmem_max" ]; then
sysctl -w net.core.wmem_max=$(generate_random_number 4096 16777216)
sysctl -w net.core.wmem_max="$(generate_random_number 4096 16777216)"
fi

# Memory management settings
sysctl -w vm.swappiness=$(generate_random_number 0 100)
sysctl -w vm.overcommit_memory=$(generate_random_number 0 2)
sysctl -w vm.swappiness="$(generate_random_number 0 100)"
sysctl -w vm.overcommit_memory="$(generate_random_number 0 2)"

echo "done"
2 changes: 2 additions & 0 deletions tests/ffi/deny_sched_setattr/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -euvx

# shellcheck source=tests/ffi/common/prepare.sh
. ../common/prepare.sh

export QM_HOST_REGISTRY_DIR="/var/qm/lib/containers/registry"
Expand All @@ -16,6 +17,7 @@ run_container_in_qm "ffi-qm"
return_from_sched_setattr=$(podman exec -it qm /bin/bash -c \
'podman exec -it ffi-qm ./QM/execute_sched_setattr')

# shellcheck disable=SC2076
if [[ "${return_from_sched_setattr}" =~ "${expected_result}" ]]; then
info_message "QM not allow SCHED_DEADLINE be set via sched_setattr() syscall."
else
Expand Down
1 change: 1 addition & 0 deletions tests/ffi/deny_set_scheduler/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -euvx

# shellcheck source=tests/ffi/common/prepare.sh
. ../common/prepare.sh

export QM_HOST_REGISTRY_DIR="/var/qm/lib/containers/registry"
Expand Down
2 changes: 1 addition & 1 deletion tests/ffi/qm-oom-score-adj/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ podman exec -it qm /bin/bash -c \
QM_PID=$(podman inspect qm --format '{{.State.Pid}}' | tr -d '\r')
QM_FFI_PID=$(podman exec -it qm /bin/bash -c "podman inspect ffi-qm --format '{{.State.Pid}}'" | tr -d '\r')

QM_OOM_SCORE_ADJ=$(cat /proc/$QM_PID/oom_score_adj)
QM_OOM_SCORE_ADJ=$(cat "/proc/$QM_PID/oom_score_adj")
QM_FFI_OOM_SCORE_ADJ=$(podman exec -it qm /bin/bash -c "cat /proc/$QM_FFI_PID/oom_score_adj" | tr -d '\r')


Expand Down
2 changes: 1 addition & 1 deletion tests/ffi/sysctl/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sysctl_num=$(podman exec qm /bin/bash -c \
# - Network subsystem
# - Virtual memory subsystem
SYSCTL_DENIED_COUNT=5
if [ $sysctl_num -eq "${SYSCTL_DENIED_COUNT}" ];then
if [ "$sysctl_num" -eq "${SYSCTL_DENIED_COUNT}" ];then
info_message "Attempt to change OS level are denied successfully inside QM container."
exit 0
fi
Loading