Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
414 changes: 414 additions & 0 deletions plugins/yanger_yin.erl

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions test/lux/yin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include ../../support/*_testcases.mk

build:

clean:
rm -rf lux_logs _tmp_*

.PHONY: build clean
11 changes: 11 additions & 0 deletions test/lux/yin/parent.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module parent {
namespace urn:parent;
prefix parent;

container parent-container {
// to be augmented by small6
}
container parent-container-2 {
// to be augmented by small6
}
}
36 changes: 36 additions & 0 deletions test/lux/yin/small6.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module small6 {
namespace urn:r;
prefix rprefix;

import parent {
prefix parentPrefix;
}

augment "/parentPrefix:parent-container" {
list test-list {
key test-key;

leaf test-key {
type string;
}

leaf dummy {
type uint16;
}
}
}

augment "/parentPrefix:parent-container-2" {
list test-list {
key test-key;

leaf test-key {
type string;
}

leaf dummy {
type uint16;
}
}
}
}
30 changes: 30 additions & 0 deletions test/lux/yin/test_good/a.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module a {
namespace "urn:a";
prefix a;

grouping a {
leaf a {
type leafref {
path "/a:x/a:y/a:k1";
}
}
leaf b {
type leafref {
path "deref(../a)/../a:k2";
// path "/a:x/a:y[a:k1 = current()/../a]/a:k2";
}
}
}

container x {
list y {
key "k1 k2";
leaf k1 {
type string;
}
leaf k2 {
type string;
}
}
}
}
12 changes: 12 additions & 0 deletions test/lux/yin/test_good/b.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module b {
namespace "urn:b";
prefix b;

import a {
prefix a;
}

container z {
uses a:a;
}
}
6 changes: 6 additions & 0 deletions test/lux/yin/test_good/q.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module q {
namespace urn:q;
prefix q;

include qs;
}
20 changes: 20 additions & 0 deletions test/lux/yin/test_good/qs.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
submodule qs {
belongs-to q {
prefix q;
}

extension foo {
argument id;
}

identity foo;

feature foo;

grouping g {
leaf x {
type string;
}
}

}
42 changes: 42 additions & 0 deletions test/lux/yin/test_good/w.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module w {
namespace urn:w;
prefix w;

import q {
prefix qq;
}

identity g {
base qq:foo;
}

grouping X {
leaf y {
qq:foo 42;
type uint32;
}
}

grouping Y {
container z {
if-feature qq:foo;
uses X;
}
}
uses Y {
refine z/y {
default 42;
}
}

container q {
uses qq:g;
}
leaf t {
type leafref {
path "/q/x";
}
}


}
15 changes: 15 additions & 0 deletions test/lux/yin/test_good/xt10.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module xt10 {
namespace "urn:xt10";
prefix "xt10";

typedef a {
type string;
}

leaf x {
type decimal64 {
fraction-digits 1;
range "-6.3..0.0";
}
}
}
28 changes: 28 additions & 0 deletions test/lux/yin/test_good/xt5.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module xt5 {

namespace "urn:test:xt5";
prefix xt5;

grouping x {
leaf foo { type empty; mandatory true; }
}

typedef xc {
type int32;
}

extension x {
argument name;
}

leaf foo { type int16; }


extension foo {
argument bar {
yin-element true;
}
}


}
18 changes: 18 additions & 0 deletions test/lux/yin/test_good/xt6.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module xt6 {

namespace "urn:test:xt6";
prefix xt6;

import xt5 {
prefix xt5;
}

uses xt5:x;

xt5:foo "barbar";

leaf y {
type xt5:xc;
}

}
29 changes: 29 additions & 0 deletions test/lux/yin/test_good/xt7.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module xt7 {
prefix x;
namespace "urn:test:xt7";

leaf foo {
type int16;
x:foo "some string";
}

x:foo "another string";

extension foo {
argument bar {
yin-element false;
}
}

grouping baz {
leaf x {
type int32;
}
}
uses baz {
refine x {
default 42;
}
}

}
36 changes: 36 additions & 0 deletions test/lux/yin/test_good/yt10.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module yt10 {

namespace "urn:ietf:params:xml:ns:yang:yt10";

prefix "yt10";

import yt9 { prefix yt9; }

organization "Netconf Central";

contact "Andy Bierman";

description "YANG test module 9. augment";

revision 2008-04-11 { description "initial version"; }

augment /yt9:con1 {
leaf b1 { type int32; }

container con2 {
leaf b2 { type string; }
}
}

container test {
description "Particular configuration to retrieve.";
// mandatory true;
uses Foo;
}

grouping Foo {
leaf X { type int32; }
leaf Y { type uint32; }
}

}
Loading