Add counters for generated notifications.
[sim/o1-interface.git] / ntsimulator / yang / sysrepo-configuration-load.sh
1 #!/bin/bash
2 ################################################################################
3 #
4 # Copyright 2019 highstreet technologies GmbH and others
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9
10 #     http://www.apache.org/licenses/LICENSE-2.0
11
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ################################################################################
18
19 sleep 20
20
21 echo "Loading data into sysrepo..."
22
23 pyang -f sample-xml-skeleton --sample-xml-list-entries 2 *.yang
24
25 result=$(netopeer2-cli <<-END
26         connect --host 127.0.0.1 --login netconf
27         user-rpc --content=/opt/dev/yang/edit_config_operation.xml
28         disconnect
29 END
30 )
31
32 count=1
33
34 while [[ $count -le 100 ]] && [[ "$result" != "OK" ]]
35 do
36   ((count++))
37   pyang -f sample-xml-skeleton --sample-xml-list-entries 2 *.yang
38   
39   result=$(netopeer2-cli <<-END
40         connect --host 127.0.0.1 --login netconf
41         user-rpc --content=edit_config_operation.xml
42         disconnect
43 END
44 )
45 done
46
47 echo "Finished loading data into sysrepo. Removing edit-config XML..."
48 rm -f /opt/dev/yang/edit_config_operation.xml
49
50 echo "Done..."
51
52
53 exit 0