summaryrefslogtreecommitdiff
path: root/src/tests/test_template.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-02 18:32:47 +0200
committerGitHub <noreply@github.com>2024-04-02 18:32:47 +0200
commit1d34bd8cc062573d5c89bc57c1010e131bac75f9 (patch)
treec5f67c11122a15a6a9136c04c4de49506c899bc3 /src/tests/test_template.py
parent7ee2f016878ed29120baa66f8e1d372f97402c96 (diff)
parente5af1f0905991103b12302892e6f0070bbb7b770 (diff)
downloadvyos-1x-1d34bd8cc062573d5c89bc57c1010e131bac75f9.tar.gz
vyos-1x-1d34bd8cc062573d5c89bc57c1010e131bac75f9.zip
Merge pull request #3229 from c-po/multi-vrf
T6192: allow binding SSH to multiple VRF instances
Diffstat (limited to 'src/tests/test_template.py')
-rw-r--r--src/tests/test_template.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/test_template.py b/src/tests/test_template.py
index aba97015e..dbb86b40b 100644
--- a/src/tests/test_template.py
+++ b/src/tests/test_template.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020-2023 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 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
@@ -14,9 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import os
import vyos.template
+from vyos.utils.network import interface_exists
from ipaddress import ip_network
from unittest import TestCase
@@ -26,7 +26,7 @@ class TestVyOSTemplate(TestCase):
def test_is_interface(self):
for interface in ['lo', 'eth0']:
- if os.path.exists(f'/sys/class/net/{interface}'):
+ if interface_exists(interface):
self.assertTrue(vyos.template.is_interface(interface))
else:
self.assertFalse(vyos.template.is_interface(interface))