mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-20 19:33:18 +01:00
Adding TR181-2.16 xml
This commit is contained in:
parent
ceec718bf7
commit
8d4298b537
9 changed files with 81879 additions and 48486 deletions
|
|
@ -30,14 +30,14 @@ It is a [python script](../../tools/convert_dm_xml_to_json.py) to convert Data M
|
|||
$ ./convert_dm_xml_to_json.py
|
||||
Usage: ./convert_dm_xml_to_json.py <tr-xxx cwmp xml data model> <tr-xxx usp xml data model> [Object path]
|
||||
Examples:
|
||||
- ./convert_dm_xml_to_json.py tr-181-2-15-0-cwmp-full.xml tr-181-2-15-0-usp-full.xml Device.
|
||||
- ./convert_dm_xml_to_json.py tr-181-2-*-cwmp-full.xml tr-181-2-*-usp-full.xml Device.
|
||||
==> Generate the json file of the sub tree Device. in tr181.json
|
||||
- ./convert_dm_xml_to_json.py tr-104-2-0-2-cwmp-full.xml tr-104-2-0-2-usp-full.xml Device.Services.VoiceService.
|
||||
==> Generate the json file of the sub tree Device.Services.VoiceService. in tr104.json
|
||||
- ./convert_dm_xml_to_json.py tr-106-1-2-0-full.xml Device.
|
||||
==> Generate the json file of the sub tree Device. in tr106.json
|
||||
|
||||
Example of xml data model file: https://www.broadband-forum.org/cwmp/tr-181-2-15-0-cwmp-full.xml
|
||||
Example of xml data model file: https://www.broadband-forum.org/cwmp/tr-181-2-*-cwmp-full.xml
|
||||
```
|
||||
|
||||
## XML generator
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ generate_report python_test ./funl-result.log
|
|||
|
||||
# run functional on bbf object validation
|
||||
cp -r ./schemas/ubus/bbfdm.json /usr/share/rpcd/schemas/bbf.json
|
||||
ubus-api-validator -t 5 -f ./test/funl/validation/bbf.validation.json > ./funl-result.log
|
||||
ubus-api-validator -t 10 -f ./test/funl/validation/bbf.validation.json > ./funl-result.log
|
||||
fault=$?
|
||||
generate_report bbf_positive ./funl-result.log
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ echo "Validate CWMPManagementServer JSON Plugin"
|
|||
check_ret $?
|
||||
|
||||
echo "Validate TR-181 JSON Plugin after generating from XML"
|
||||
json_path=$(./tools/convert_dm_xml_to_json.py test/tools/tr-181-2-15-0-cwmp-full.xml test/tools/tr-181-2-15-0-usp-full.xml Device.)
|
||||
json_path=$(./tools/convert_dm_xml_to_json.py test/tools/tr-181-2-*-cwmp-full.xml test/tools/tr-181-2-*-usp-full.xml Device.)
|
||||
./tools/validate_json_plugin.py $json_path
|
||||
check_ret $?
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -510,7 +510,10 @@ def printOBJ(dmobject, hasobj, hasparam, bbfdm_type):
|
|||
|
||||
fp = open('./.json_tmp', 'a', encoding='utf-8')
|
||||
print("\"type\" : \"object\",", file=fp)
|
||||
print("\"version\" : \"%s\"," % dmobject.get('version'), file=fp)
|
||||
|
||||
if dmobject.get('version'):
|
||||
print("\"version\" : \"%s\"," % dmobject.get('version'), file=fp)
|
||||
|
||||
print("\"protocols\" : [%s]," % bbfdm_type, file=fp)
|
||||
print("\"description\" : \"%s\"," % getParamDesc(dmobject, None), file=fp)
|
||||
if uniquekeys is not None:
|
||||
|
|
@ -542,7 +545,9 @@ def printPARAM(dmparam, dmobject, bbfdm_type):
|
|||
if dmparam.get('mandatory') == "true":
|
||||
print("\"mandatory\" : true,", file=fp)
|
||||
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
if dmparam.get('version'):
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
|
||||
print("\"protocols\" : [%s]," % bbfdm_type, file=fp)
|
||||
print("\"description\" : \"%s\"," % getParamDesc(dmparam, datatype), file=fp)
|
||||
|
||||
|
|
@ -641,7 +646,10 @@ def printCOMMAND(dmparam, dmobject, _bbfdm_type):
|
|||
print("\"type\" : \"command\",", file=fp)
|
||||
print("\"async\" : %s," %
|
||||
("true" if dmparam.get('async') is not None else "false"), file=fp)
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
|
||||
if dmparam.get('version'):
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
|
||||
inputfound = 0
|
||||
outputfound = 0
|
||||
for c in dmparam:
|
||||
|
|
@ -680,7 +688,10 @@ def printEVENT(dmparam, dmobject, _bbfdm_type):
|
|||
fp = open('./.json_tmp', 'a', encoding='utf-8')
|
||||
print("\"%s\" : {" % dmparam.get('name'), file=fp)
|
||||
print("\"type\" : \"event\",", file=fp)
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
|
||||
if dmparam.get('version'):
|
||||
print("\"version\" : \"%s\"," % dmparam.get('version'), file=fp)
|
||||
|
||||
has_param = 0
|
||||
for c in dmparam:
|
||||
if c.tag == "parameter":
|
||||
|
|
@ -710,15 +721,15 @@ def printusage():
|
|||
sys.argv[0] + " <tr-xxx cwmp xml data model> <tr-xxx usp xml data model> [Object path]")
|
||||
print("Examples:")
|
||||
print(" - " + sys.argv[0] +
|
||||
" tr-181-2-15-0-cwmp-full.xml tr-181-2-15-0-usp-full.xml Device.")
|
||||
" test/tools/tr-181-2-*-cwmp-full.xml test/tools/tr-181-2-*-usp-full.xml Device.")
|
||||
print(" ==> Generate the json file of the sub tree Device. in tr181.json")
|
||||
print(" - " + sys.argv[0] +
|
||||
" tr-104-2-0-2-cwmp-full.xml tr-104-2-0-2-usp-full.xml Device.Services.VoiceService.")
|
||||
" test/tools/tr-104-2-0-2-cwmp-full.xml test/tools/tr-104-2-0-2-usp-full.xml Device.Services.VoiceService.")
|
||||
print(" ==> Generate the json file of the sub tree Device.Services.VoiceService. in tr104.json")
|
||||
print(" - " + sys.argv[0] + " tr-106-1-2-0-full.xml Device.")
|
||||
print(" - " + sys.argv[0] + " test/tools/tr-106-1-2-0-full.xml Device.")
|
||||
print(" ==> Generate the json file of the sub tree Device. in tr106.json")
|
||||
print("")
|
||||
print("Example of xml data model file: https://www.broadband-forum.org/cwmp/tr-181-2-15-0-cwmp-full.xml")
|
||||
print("Example of xml data model file: https://www.broadband-forum.org/cwmp/tr-181-2-*-cwmp-full.xml")
|
||||
exit(1)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def generate_bbf_xml_file(output_file, dm_json_files=None):
|
|||
root.set("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
|
||||
root.set("xsi:schemaLocation", "urn:broadband-forum-org:cwmp:datamodel-1-8 https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-8.xsd urn:broadband-forum-org:cwmp:datamodel-report-0-1 https://www.broadband-forum.org/cwmp/cwmp-datamodel-report.xsd")
|
||||
root.set("spec", "urn:broadband-forum-org:tr-181-2-14-1-cwmp")
|
||||
root.set("file", "tr-181-2-15-0-cwmp-full.xml")
|
||||
root.set("file", "tr-181-2-16-0-cwmp-full.xml")
|
||||
|
||||
model = ET.SubElement(root, "model")
|
||||
model.set("name", "Device:2.14")
|
||||
|
|
|
|||
|
|
@ -65,8 +65,7 @@ obj_schema = {
|
|||
"type",
|
||||
"protocols",
|
||||
"array",
|
||||
"access",
|
||||
"version"
|
||||
"access"
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -128,8 +127,7 @@ obj_schema_v1 = {
|
|||
"type",
|
||||
"protocols",
|
||||
"array",
|
||||
"access",
|
||||
"version"
|
||||
"access"
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -212,8 +210,7 @@ param_schema = {
|
|||
"type",
|
||||
"protocols",
|
||||
"read",
|
||||
"write",
|
||||
"version"
|
||||
"write"
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +237,6 @@ event_schema = {
|
|||
},
|
||||
"required": [
|
||||
"type",
|
||||
"version",
|
||||
"protocols"
|
||||
]
|
||||
}
|
||||
|
|
@ -271,8 +267,7 @@ command_schema = {
|
|||
"required": [
|
||||
"type",
|
||||
"async",
|
||||
"protocols",
|
||||
"version"
|
||||
"protocols"
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue