From 3f6cf3fd9ac0f42719c21e34d3b9dae6224f6a67 Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Tue, 30 May 2017 11:23:03 +0200 Subject: [PATCH] Add binary compilation of enumerations test --- src/lib/yang/binary.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lib/yang/binary.lua b/src/lib/yang/binary.lua index 8971752bf6..76e5de5e60 100644 --- a/src/lib/yang/binary.lua +++ b/src/lib/yang/binary.lua @@ -437,12 +437,30 @@ function selftest() leaf-list integers { type uint32; } leaf-list addrs { type inet:ipv4-address; } + + typedef severity { + type enumeration { + enum indetermiante { + value 2; + } + enum minor { + value 3; + } + enum warning { + value 4; + } + } + } + container routes { list route { key addr; leaf addr { type inet:ipv4-address; mandatory true; } leaf port { type uint8 { range 0..11; } mandatory true; } } + leaf severity { + type severity; + } } }]]) local data = data.load_data_for_schema(test_schema, [[ @@ -456,6 +474,7 @@ function selftest() route { addr 1.2.3.4; port 1; } route { addr 2.3.4.5; port 10; } route { addr 3.4.5.6; port 2; } + severity minor; } ]])