From 0611bdfb39d25837ed2f6121d0963416af696f43 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Wed, 7 Feb 2024 08:31:19 +0800 Subject: [PATCH] [202311][dhcp_server][yang] Update supported option type to string (#18029) (#18043) --- src/sonic-yang-models/doc/Configuration.md | 2 +- .../tests/files/sample_config_db.json | 2 +- .../tests/dhcp_server_ipv4.json | 4 +-- .../tests_config/dhcp_server_ipv4.json | 26 +++++++++---------- .../yang-models/sonic-dhcp-server-ipv4.yang | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 64de05a809d0..00465d666b1b 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1024,7 +1024,7 @@ IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DH "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "option60": { "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } }, diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e5ff0b26a8ae..0355d7eb7b0b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1924,7 +1924,7 @@ "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "option60": { "id": "60", - "type": "text", + "type": "string", "value": "dummy_value" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json index b3d301150de0..cc70b89372cd 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json @@ -35,8 +35,8 @@ "eStrKey": "InvalidValue", "eStr": ["type"] }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { - "desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_STRING": { + "desc": "Add string type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." }, "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { "desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json index 3ea58eb67957..3b56a815901d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json @@ -46,7 +46,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -171,7 +171,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -230,7 +230,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -248,14 +248,14 @@ } } }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_STRING": { "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -325,7 +325,7 @@ { "name": "option60", "id": 60, - "type": "texts", + "type": "text", "value": "dummy_value" } ] @@ -448,7 +448,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -529,7 +529,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -610,7 +610,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -691,7 +691,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -772,7 +772,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -814,7 +814,7 @@ "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ { "name": "option60", - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -828,7 +828,7 @@ { "name": "option60", "id": 60, - "type": "text" + "type": "string" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang index 065366639d87..3f868028a964 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang @@ -130,7 +130,7 @@ module sonic-dhcp-server-ipv4 { leaf type { description "Type of customized option, for standard DHCP option, this field is invalid"; type enumeration { - enum text; + enum string; enum ipv4-address; enum uint8; enum uint16;