Skip to content

Commit

Permalink
* Removed docker warning: set master default branch
Browse files Browse the repository at this point in the history
* Test: check commit for cli union
  • Loading branch information
olofhagsand committed Feb 17, 2022
1 parent 1324c91 commit 4631b02
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
11 changes: 9 additions & 2 deletions docker/main/Dockerfile.fcgi
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ RUN apk add --update git make build-base gcc flex bison fcgi-dev curl-dev

# Checkut standard YANG models for tests (note >1G for full repo)
WORKDIR /usr/local/share
RUN mkdir yang; cd yang; git init; git remote add -f origin https://github.com/YangModels/yang; git config core.sparseCheckout true; echo "standard/" >> .git/info/sparse-checkout; echo "experimental/" >> .git/info/sparse-checkout

RUN mkdir yang
WORKDIR /usr/local/share/yang

RUN git config --global init.defaultBranch master
RUN git init;
RUN git remote add -f origin https://github.com/YangModels/yang;
RUN git config core.sparseCheckout true
RUN echo "standard/" >> .git/info/sparse-checkout
RUN echo "experimental/" >> .git/info/sparse-checkout

RUN git pull origin master

# Create a directory to hold source-code, dependencies etc
Expand Down
10 changes: 9 additions & 1 deletion docker/main/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ RUN apk add --update nghttp2
WORKDIR /usr/local/share/

# Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang; cd yang; git init; git remote add -f origin https://github.com/YangModels/yang; git config core.sparseCheckout true; echo "standard/" >> .git/info/sparse-checkout; echo "experimental/" >> .git/info/sparse-checkout
RUN mkdir yang

WORKDIR /usr/local/share/yang

RUN git config --global init.defaultBranch master
RUN git init;
RUN git remote add -f origin https://github.com/YangModels/yang;
RUN git config core.sparseCheckout true
RUN echo "standard/" >> .git/info/sparse-checkout
RUN echo "experimental/" >> .git/info/sparse-checkout

RUN git pull origin master

RUN mkdir /usr/local/share/openconfig
Expand Down
16 changes: 14 additions & 2 deletions test/test_cli_union.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ delete("Delete a configuration item") @datamodel, cli_auto_del();
validate("Validate changes"), cli_validate();
commit("Commit the changes"), cli_commit();
quit("Quit"), cli_quit();
show("Show a particular state of the system")
configuration("Show configuration"), cli_auto_show("datamodel", "candidate", "text", true, false);
show("Show a particular state of the system"){
auto("Show expand") @datamodel, cli_show_auto("running", "xml", "set");
candidate("Show configuration"), cli_auto_show("datamodel", "candidate", "xml", false, false);
running("Show configuration"), cli_auto_show("datamodel", "running", "xml", false, false);
}
EOF

new "test params: -f $cfg"
Expand Down Expand Up @@ -138,6 +141,15 @@ if [ $count -gt 1 ]; then
err "number of u1: 1" $count
fi

new "cli commit"
expectpart "$($clixon_cli -1 -f $cfg commit)" 0 "^$"

new "show candidate"
expectpart "$($clixon_cli -1 -f $cfg show candidate)" 0 '<tableleaf xmlns="urn:example:clixon"><parleaf><name>a</name><value>u1</value></parleaf></tableleaf>' '<tablekey xmlns="urn:example:clixon"><parkey><name>u1</name><value>42</value></parkey></tablekey>'

new "show running"
expectpart "$($clixon_cli -1 -f $cfg show running)" 0 '<tableleaf xmlns="urn:example:clixon"><parleaf><name>a</name><value>u1</value></parleaf></tableleaf>' '<tablekey xmlns="urn:example:clixon"><parkey><name>u1</name><value>42</value></parkey></tablekey>'

if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
Expand Down

0 comments on commit 4631b02

Please sign in to comment.