Skip to content

Commit

Permalink
Merge branch 'T5083-dev' into T5083
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasfinstad committed Jun 19, 2024
2 parents ff5dd56 + f06e563 commit 2f34d36
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 39 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface_definitions: $(config_xml_obj)
find $(BUILD_DIR)/interface-definitions -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1

$(CURDIR)/python/vyos/xml_ref/generate_cache.py --xml-dir $(BUILD_DIR)/interface-definitions || exit 1
$(CURDIR)/python/vyos/xml_ref/update_cache.py || exit 1

# XXX: delete top level node.def's that now live in other packages
# IPSec VPN EAP-RADIUS does not support source-address
Expand Down
16 changes: 9 additions & 7 deletions interface-definitions/container.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,15 @@
<tagNode name="registry">
<properties>
<help>Registry Name</help>
<oneWayDependantChildren>
<dependants><child>authentication</child></dependants>
<dependees>
<child>username</child>
<child>password</child>
</dependees>
</oneWayDependantChildren>
<childSpecification>
<oneWayDependantChildren>
<dependants><child>authentication</child></dependants>
<dependees>
<child>username</child>
<child>password</child>
</dependees>
</oneWayDependantChildren>
</childSpecification>
</properties>
<defaultValue>docker.io quay.io</defaultValue>
<children>
Expand Down
2 changes: 2 additions & 0 deletions schema/interface_definition.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# The language of this file is compact form RELAX-NG
# https://relaxng.org/compact-tutorial-20030326.html
# (unless converted to XML, then just RELAX-NG :)
#
# A useful tool to find errors in the generated schemas can be found at https://www.liquid-technologies.com/online-relaxng-validator

# Interface definition starts with interfaceDefinition tag that may contain node tags
start = element interfaceDefinition
Expand Down
2 changes: 2 additions & 0 deletions schema/interface_definition.rng
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
The language of this file is compact form RELAX-NG
https://relaxng.org/compact-tutorial-20030326.html
(unless converted to XML, then just RELAX-NG :)
A useful tool to find errors in the generated schemas can be found at https://www.liquid-technologies.com/online-relaxng-validator
-->
<!-- Interface definition starts with interfaceDefinition tag that may contain node tags -->
<start>
Expand Down
32 changes: 0 additions & 32 deletions src/tests/test_xml_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,6 @@

import unittest, sys, pathlib
from copy import deepcopy

# Useful for running only this test as a script instead of waiting for all tests to run,
# also makes it easier to run debuggers in some cases.
if __name__ == "__main__":
root = pathlib.Path(__file__)
root = root.parent.parent.parent

# Fix import for vyos module in general
p = root.joinpath("python")
print("adding path", p)
sys.path.append(str(p))

# Fix import for update_cache
p = root.joinpath("python/vyos/xml_ref")
print("adding path", p)
sys.path.append(str(p))


from vyos.configsession import ConfigSessionError
from vyos.xml_ref.child_specification import CSChildSpecification

Expand Down Expand Up @@ -98,20 +80,6 @@
)

class TestChildSpecification(unittest.TestCase):
xml_cache_path = pathlib.Path(__file__).parent.parent.parent.joinpath("python/vyos/xml_ref/cache.py")
created_cache = False

def setUp(self):
if not self.xml_cache_path.exists():
from vyos.xml_ref.update_cache import main as updator

updator()
self.created_cache = True

def tearDown(self) -> None:
if self.created_cache:
self.xml_cache_path.unlink()

def test_all_good(self):
# Verify good config
CHILD_SPEC.verify(RPATH, BASE_CONF)
Expand Down

0 comments on commit 2f34d36

Please sign in to comment.