summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2024-04-03T6199: drop unused Python importsChristian Breunig
found using "git ls-files *.py | xargs pylint | grep W0611" (cherry picked from commit 274b2da242acd1f1f64ff1dee471e34295137c5f)
2024-04-02utils: T5738: always use vyos.utils.network.interface_exists over os.path.existsChristian Breunig
(cherry picked from commit 5bb27f0c6220fd940b63cdd37a60c312c0ac3efd)
2024-01-01T5474: establish common file name pattern for XML conf mode commandsChristian Breunig
We will use _ as CLI level divider. The XML definition filename and also the Python helper should match the CLI node. Example: set interfaces ethernet -> interfaces_ethernet.xml.in set interfaces bond -> interfaces_bond.xml.in set service dhcp-server -> service_dhcp-server-xml.in (cherry picked from commit 4ef110fd2c501b718344c72d495ad7e16d2bd465)
2023-12-29tests: T5869: consolidate duplicated test casesChristian Breunig
We have had duplicated test cases in test_jinja_filters.py and test_template.py, They have been consolidated into test_template.py. (cherry picked from commit 80e2e80b5504d1da643a0d5c9772a1f9dee0aa99)
2023-12-29vyos.template: T5869: first_host_address() does not honor RFC4291 section 2.6.1Christian Breunig
The subnet router anycast address is predefined. Its format is as follows: | n bits | 128-n bits | +------------------------------------------------+----------------+ | subnet prefix | 00000000000000 | +------------------------------------------------+----------------+ The "subnet prefix" in an anycast address is the prefix that identifies a specific link. This anycast address is syntactically the same as a unicast address for an interface on the link with the interface identifier set to zero. Packets sent to the Subnet-Router anycast address will be delivered to one router on the subnet. All routers are required to support the Subnet-Router anycast addresses for the subnets to which they have interfaces. The Subnet-Router anycast address is intended to be used for applications where a node needs to communicate with any one of the set of routers. Our code as of now returns the subnet router anycast address as the first_host_address(). (cherry picked from commit cc4ce81ece57faca8ce111b8f3748389ecb40202)
2023-09-27conf-mode: T5412: move dependency check from smoketest to nosetestJohn Estabrook
(cherry picked from commit 12440ea1af8e60482a6a91c1cb04dcb86d7f4a68)
2023-08-10T5434: use package specific cache in nosetestsJohn Estabrook
2023-08-06smoketest: T5428: check for process running in designated VRFChristian Breunig
Start IPv4/IPv6 DHCP clients on an interface bound to a given VRF. Verify that the client process runs in the VRF context.
2023-08-06T5195: move helpers from vyos.validate to vyos.utils packageChristian Breunig
2023-07-15T5195: remove obsoleted mangle_dict_keysJohn Estabrook
2023-07-15T5195: vyos.util -> vyos.utils package refactoring part #2Christian Breunig
2023-07-14T5195: vyos.util -> vyos.utils package refactoring (#2093)Christian Breunig
* T5195: move run, cmd, call, rc_cmd helper to vyos.utils.process * T5195: use read_file and write_file implementation from vyos.utils.file Changed code automatically using: find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import read_file$/from vyos.utils.file import read_file/g' {} + find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import write_file$/from vyos.utils.file import write_file/g' {} + * T5195: move chmod* helpers to vyos.utils.permission * T5195: use colon_separated_to_dict from vyos.utils.dict * T5195: move is_systemd_service_* to vyos.utils.process * T5195: fix boot issues with missing imports * T5195: move dict_search_* helpers to vyos.utils.dict * T5195: move network helpers to vyos.utils.network * T5195: move commit_* helpers to vyos.utils.commit * T5195: move user I/O helpers to vyos.utils.io
2023-07-12T5195: drop sysctl_* implementation from vyos.util - prefer vyos.utils.systemChristian Breunig
2023-05-11vyos.util: T5195: remove the unused camel case to snake case functionDaniil Baturin
that was replaced with Humps in all sciprts
2023-03-29configdiff: T5089: add unit testJohn Estabrook
2023-03-29configtree: T5089: sorting of nodes is now implemented on parsing configJohn Estabrook
2023-02-13debian: T5003: Fixes for Debian Bookwormsarthurdev
* DH params of 256 length no longer supported
2022-10-25vyos.util: T4773: add camel_to_snake_case conversionJohn Estabrook
2022-10-21T4765: support list and primitives in op mode output normalizationcreate with ansible
2022-10-20T4765: normalize dict fields in op mode ouputsDaniil Baturin
2022-04-07ipv6: T4346: delete (migrate) CLI command to disable IPv6 address familyChristian Poessinger
2022-03-30vyos.util: T4319: add is_ipv6_enabled() helper functionChristian Poessinger
2022-01-03test: vyos.validate: also test interface identifier in is_ipv6_link_local()Christian Poessinger
2021-09-06vyos.util: add function to search a key recursively in a dictionaryChristian Poessinger
data = { 'interfaces': {'dummy': {'dum0': {'address': ['192.0.2.17/29']}}, 'ethernet': {'eth0': {'address': ['2001:db8::1/64', '192.0.2.1/29'], 'description': 'Test123', 'duplex': 'auto', 'hw_id': '00:00:00:00:00:01', 'speed': 'auto'}, 'eth1': {'address': ['192.0.2.9/29'], 'description': 'Test456', 'duplex': 'auto', 'hw_id': '00:00:00:00:00:02', 'speed': 'auto'}}} } dict_search_recursive(data, 'hw_id') will yield both '00:00:00:00:00:01' and '00:00:00:00:00:02' as generator object.
2021-07-03ipsec: T2816: add Jinja2 converter for ESP/IKE groups to stringChristian Poessinger
2021-07-01vyos.util: remove no longer needed copy_file helper methodChristian Poessinger
The IPSec ceritifcate handling is now done by storing the CA key inside the running configuration.
2021-06-26vyos.util: add new helper copy_file()Christian Poessinger
Copy a file from A -> B but also support adjusting Bs file permissions and creation of Bs base directory if required.
2021-04-05vyos.template: T3418: add new is_interface helper functionChristian Poessinger
2021-03-23vyos.util: dict_search() should not throw exception when inputs are NoneChristian Poessinger
2021-02-24test: remove "test_ethtool.py" as this does not run on JenkinsChristian Poessinger
2021-02-24ethernet: T3163: fix typos in vyos.ethtool commentsChristian Poessinger
2021-02-24ethernet: T3163: not all NIC drivers support ring-buffer configurationChristian Poessinger
In addition to commit cf1156a60e ("ethernet: T3163: probe driver for maximum rx/tx ring-buffer size") this extends the logic in a way as not every driver supports setting the buffers at all so it will properly error out. When invoking "ethtool -g" both stdout and stderr are captured and no exception is raised if it's an unsupported driver feature. The verify() section will inform the user about the illegal operation.
2021-01-19nat: T2947: add many-many translationChristian Poessinger
Support a 1:1 or 1:n prefix translation. The following configuration will NAT source addresses from the 10.2.0.0/16 range to an address from 192.0.2.0/29. For this feature to work a Linux Kernel 5.8 or higher is required! vyos@vyos# show nat source { rule 100 { outbound-interface eth1 source { address 10.2.0.0/16 } translation { address 192.0.2.0/29 } } } This results in the nftables configuration: chain POSTROUTING { type nat hook postrouting priority srcnat; policy accept; oifname "eth1" counter packets 0 bytes 0 snat ip prefix to ip saddr map { 10.2.0.0/16 : 192.0.2.0/29 } comment "SRC-NAT-100" }
2020-12-10test: vyos.validate: check is_addr_assigned()Christian Poessinger
2020-12-06Revert "vyos.ifconfig: T1579: do not remove IPv6 link-local address on ↵Christian Poessinger
reconfiguration" This reverts commit d247736f67cc056062b75a4215a031bebcfee2ee. We need to clean link-local IPv6 addresses on link reconfiguration to also drop no longer existing link-local addresse son MAC address change.
2020-12-06vyos.ifconfig: T1579: do not remove IPv6 link-local address on reconfigurationChristian Poessinger
2020-12-06test: vyos.template: test additional templating functionsChristian Poessinger
2020-11-13vyos.template: provide general is_ip(v4|v6) helpersChristian Poessinger
We had two places were the is_ip, is_ipv4 and is_ipv6 helpers had been defined. All places now have been converged into vyos.template as they are used both in the Jinja2 templates and also in our scripts.
2020-11-01openvpn: T2994: re-add ifconfig-pool statement in server configChristian Poessinger
Re-organize the template code and add addtitional Jinja2 filters for processing the ifconfig-pool statement. This reverts the changes from commit 7e546be9 ("openvpn: T2994: temporary revert to 1.2 crux behavior for client pools").
2020-11-01test: extend validate testcasesChristian Poessinger
Test additional network combinations of address and prefixes.
2020-11-01openvpn: T2994: remove workarounds for individual ipv4 and ipv6 keysChristian Poessinger
Remove workaround which split (local|remote)_address and also subnet keys into individual keys for the assigned IP address family (4/6). During template rendering check IP version by introducing new ipv4 and ipv6 Jinja2 filters {% if foo | ipv4 %} or {% if bar | ipv6 %} options.
2020-11-01test: adjust testcase name for vyos.util.dict_search()Christian Poessinger
After renaming the function in commit 25551c5a ("vyos.util: T2995: rename vyos_dict_search() -> dict_search()"), the test case should be renamed, too.
2020-11-01test: vyos.validate: add unittestsChristian Poessinger
2020-10-30openvpn: T2994: verify DH key lengthChristian Poessinger
2020-10-30vyos.util: T2995: change comment style for "make test" outputChristian Poessinger
2020-10-28vyos.util: T2995: rename vyos_dict_search() -> dict_search()Christian Poessinger
Renamed using snippet below: ---------------------------- for file in $(find . -name "*.py") do sed -i "s/vyos_dict_search/dict_search/" $file done
2020-10-25test: vyos.template: add testcase for vyos_*_from_cidr() convertersChristian Poessinger
2020-10-25test: import cleanupChristian Poessinger
2020-10-24Revert "test: vyos.util: add testcase for process_named_running()"Christian Poessinger
This reverts commit 9939139ba4ad18dc4b62a827d8ab7b74d0c28124. Unfortunately this test does not work within the CI system. It fails with: 17:21:35 ====================================================================== 17:21:35 FAIL: test_process_named_running (test_util.TestVyOSUtil) 17:21:35 ---------------------------------------------------------------------- 17:21:35 Traceback (most recent call last): 17:21:35 File "/var/lib/jenkins/jenkins_slave/workspace/vyos-1x_current/build/src/tests/test_util.py", line 34, in test_process_named_running 17:21:35 self.assertTrue(isinstance(pid, int)) 17:21:35 AssertionError: False is not true As process_named_running() returns None on non existing bash process
2020-10-24test: vyos.util: add testcase for process_named_running()Christian Poessinger