From 21ce83869a25171628159fc7858d0d978449dee6 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Tue, 20 Dec 2022 17:44:28 +0000 Subject: [PATCH] Enforce sorting on the collect exclude directories Updates "tox -e linters" to call "tox -e sorted" so that zuul will enforce sorting of a particular file. This adds a sort enforcement for the collect directories The sort check runs: 'LC_ALL=c sort -c' Note: LC_ALL=c is required so that different environments such as Ubuntu and Debian will validate using the same sort ordering. Story: 2010531 Task: 47379 Signed-off-by: Al Bailey Change-Id: I739de1b43bf88ebef5da0890026827bd9599bc6f --- tools/collector/debian-scripts/run.exclude | 28 +++++++++++----------- tox.ini | 9 ++++++- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/tools/collector/debian-scripts/run.exclude b/tools/collector/debian-scripts/run.exclude index 78655446..9e9f7da4 100644 --- a/tools/collector/debian-scripts/run.exclude +++ b/tools/collector/debian-scripts/run.exclude @@ -1,17 +1,17 @@ +/var/run/.vswitch +/var/run/acpid.socket +/var/run/avahi-daemon +/var/run/containerd +/var/run/dbus/system_bus_socket +/var/run/libvirt/libvirt-sock +/var/run/libvirt/libvirt-sock-ro +/var/run/named-chroot +/var/run/neutron/metadata_proxy +/var/run/nvidia +/var/run/ostree_repo +/var/run/rpc_pipefs +/var/run/rpcbind.sock /var/run/sanlock/sanlock.sock +/var/run/systemd/inaccessible/blk /var/run/tgtd.ipc_abstract_namespace.0 /var/run/wdmd/wdmd.sock -/var/run/acpid.socket -/var/run/rpcbind.sock -/var/run/libvirt/libvirt-sock-ro -/var/run/libvirt/libvirt-sock -/var/run/dbus/system_bus_socket -/var/run/named-chroot -/var/run/avahi-daemon -/var/run/neutron/metadata_proxy -/var/run/.vswitch -/var/run/containerd -/var/run/nvidia -/var/run/rpc_pipefs -/var/run/systemd/inaccessible/blk -/var/run/ostree_repo diff --git a/tox.ini b/tox.ini index 94e4ae8e..6dd2385a 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,6 @@ sitepackages = False basepython = python3.9 install_command = pip install \ -v -v -v \ - -U \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ {opts} {packages} setenv = @@ -24,6 +23,7 @@ deps = -r{toxinidir}/test-requirements.txt allowlist_externals = bash + sort [testenv:bashate] # Treat all E* codes as Errors rather than warnings using: -e 'E*' @@ -101,10 +101,17 @@ commands = pylint {posargs} \ utilities/platform-util/platform-util/platform_util \ --rcfile=./pylint.rc +[testenv:sorted] +# sort acts differently on Ubuntu and Debian +# LC_ALL=c ensures they sort the same way +setenv = + LC_ALL=c +commands = sort -c tools/collector/debian-scripts/run.exclude [testenv:linters] commands = {[testenv:bashate]commands} + {[testenv:sorted]commands} [testenv:bandit] basepython = python3