File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ RUN apk add make git
55RUN make build
66
77FROM alpine:3.21
8+ WORKDIR /sonic
9+ COPY --from=builder /work/bin/sonic-configdb-utils /usr/bin
810
9- COPY --from=builder /work/bin/sonic-configdb-utils /
10-
11- ENTRYPOINT ["/sonic-configdb-utils" ]
11+ ENTRYPOINT ["/usr/bin/sonic-configdb-utils" ]
Original file line number Diff line number Diff line change 3030 go test ./... -count 1
3131
3232.PHONY : test-generate
33- test-generate :
33+ test-generate : docker-build
3434 ./tests/test.sh
3535
3636.PHONY : lint
3737lint :
3838 golangci-lint run --build-tags client -p bugs -p unused
39+
40+ .PHONY : docker-build
41+ docker-build :
42+ docker build -t sonic-configdb-utils:local .
Original file line number Diff line number Diff line change 33function test() {
44 test_dir=$1
55
6- go run main.go generate -i $test_dir / sonic-config.yaml -o $test_dir /config_db.json -p $test_dir /platform.json
6+ docker run --rm -v $test_dir :/usr/share/ sonic/platform:ro -v $test_dir :/etc/sonic -v $test_dir :/sonic sonic-configdb-utils:local generate
77
88 if [[ $( diff $test_dir /expected.json $test_dir /config_db.json) ]]; then
99 echo TEST in $test_dir FAILED
@@ -12,7 +12,7 @@ function test() {
1212 exit 1
1313 fi
1414
15- rm $test_dir /config_db.json
15+ rm -f $test_dir /config_db.json
1616}
1717
1818test $( pwd) /tests/1
You can’t perform that action at this time.
0 commit comments