diff options
-rwxr-xr-x | smoketest/scripts/system/test_kernel_options.py | 6 | ||||
-rwxr-xr-x | src/op_mode/show_users.py | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/smoketest/scripts/system/test_kernel_options.py b/smoketest/scripts/system/test_kernel_options.py index a39ae50bc..0e3cbd0ed 100755 --- a/smoketest/scripts/system/test_kernel_options.py +++ b/smoketest/scripts/system/test_kernel_options.py @@ -76,7 +76,6 @@ class TestKernelModules(unittest.TestCase): self.assertTrue(tmp) def test_qemu_support(self): - # The bond/lacp interface must be enabled in the OS Kernel for option in ['CONFIG_VIRTIO_BLK', 'CONFIG_SCSI_VIRTIO', 'CONFIG_VIRTIO_NET', 'CONFIG_VIRTIO_CONSOLE', 'CONFIG_VIRTIO', 'CONFIG_VIRTIO_PCI', @@ -86,11 +85,14 @@ class TestKernelModules(unittest.TestCase): self.assertTrue(tmp) def test_vmware_support(self): - # The bond/lacp interface must be enabled in the OS Kernel for option in ['CONFIG_VMXNET3']: tmp = re.findall(f'{option}=(y|m)', config) self.assertTrue(tmp) + def test_container_cgroup_support(self): + for option in ['CONFIG_CGROUPS', 'CONFIG_MEMCG', 'CONFIG_CGROUP_PIDS', 'CONFIG_CGROUP_BPF']: + tmp = re.findall(f'{option}=(y|m)', config) + self.assertTrue(tmp) if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/src/op_mode/show_users.py b/src/op_mode/show_users.py index 8e4f12851..82bd585c9 100755 --- a/src/op_mode/show_users.py +++ b/src/op_mode/show_users.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019 VyOS maintainers and contributors +# Copyright (C) 2019-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -15,7 +15,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import argparse import pwd -import spwd import struct import sys from time import ctime @@ -48,6 +47,10 @@ def is_locked(user_name: str) -> bool: """Check if a given user has password in shadow db""" try: + import warnings + with warnings.catch_warnings(): + warnings.filterwarnings("ignore",category=DeprecationWarning) + import spwd encrypted_password = spwd.getspnam(user_name)[1] return encrypted_password == '*' or encrypted_password.startswith('!') except (KeyError, PermissionError): |