Skip to content

Commit 855b626

Browse files
author
Bibhuprasad Singh
committed
gNOI Cold Reboot - Integrated gNOI repository
1 parent 8d52b9b commit 855b626

File tree

5 files changed

+104
-0
lines changed

5 files changed

+104
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@
130130
[submodule "src/sonic-stp"]
131131
path = src/sonic-stp
132132
url = https://github.com/sonic-net/sonic-stp
133+
[submodule "src/sonic-framework/gnoi"]
134+
path = src/sonic-framework/gnoi
135+
url = https://github.com/openconfig/gnoi

src/sonic-framework/Makefile.am

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.PHONY: compile_protobufs
2+
AUTOMAKE_OPTIONS = subdir-objects
3+
INCLUDES = -I ../sonic-swss-common/common -Ibuild/gen -Ibuild/gen/github.com/openconfig/gnoi
4+
BUILT_SOURCES = rebootbackend_protobuf_compilation rebootbackend_dbus_compilation
5+
6+
compile_protobufs: rebootbackend_protobuf_compilation rebootbackend_dbus_compilation
7+
8+
rebootbackend_protobuf_compilation:
9+
mkdir -p build/gen
10+
/usr/bin/protoc --cpp_out=build/gen \
11+
--proto_path=github.com/openconfig/gnoi=gnoi \
12+
gnoi/types/types.proto \
13+
gnoi/common/common.proto \
14+
gnoi/system/system.proto
15+
16+
rebootbackend_dbus_compilation: build/gen/librebgnoi.la
17+
/usr/bin/dbusxx-xml2cpp rebootbackend/gnoi_reboot.xml \
18+
--proxy=rebootbackend/gnoi_reboot_dbus.h
19+
20+
lib_LTLIBRARIES = build/gen/librebgnoi.la
21+
build_gen_librebgnoi_la_SOURCES = \
22+
build/gen/github.com/openconfig/gnoi/system/system.pb.cc \
23+
build/gen/github.com/openconfig/gnoi/types/types.pb.cc \
24+
build/gen/github.com/openconfig/gnoi/common/common.pb.cc
25+
26+
SUBDIRS = rebootbackend

src/sonic-framework/gnoi

Submodule gnoi added at 73a1e76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
AUTOMAKE_OPTIONS = subdir-objects
2+
INCLUDES = -I $(top_srcdir) -I/usr/include/dbus-c++-1/ -I$(top_srcdir)/build/gen -I$(top_srcdir)/build/gen/github.com/openconfig/gnoi -I ../../sonic-swss-common/common
3+
4+
bin_PROGRAMS = rebootbackend
5+
6+
if DEBUG
7+
DBGFLAGS = -ggdb -DDEBUG
8+
else
9+
DBGFLAGS = -g
10+
endif
11+
12+
rebootbackend_SOURCES = rebootbackend.cpp rebootbe.cpp interfaces.cpp \
13+
reboot_thread.cpp
14+
15+
rebootbackend_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_ASAN)
16+
rebootbackend_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_ASAN)
17+
rebootbackend_LDADD = $(LDFLAGS_ASAN) -lswsscommon -ldbus-c++-1 -lpthread -lprotobuf $(top_srcdir)/build/gen/librebgnoi.la

src/sonic-framework/tests/Makefile.am

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
AUTOMAKE_OPTIONS = subdir-objects
2+
INCLUDES = -I $(top_srcdir) -I $(top_srcdir)/rebootbackend -I$(top_srcdir)/build/gen -I$(top_srcdir)/build/gen/github.com/openconfig/gnoi -I ../../sonic-swss-common/common
3+
4+
TESTS = tests tests_asan tests_tsan tests_usan
5+
6+
noinst_PROGRAMS = tests tests_asan tests_tsan tests_usan
7+
8+
if DEBUG
9+
DBGFLAGS = -ggdb -DDEBUG
10+
else
11+
DBGFLAGS = -g -DNDEBUG
12+
endif
13+
14+
CFLAGS_GTEST =
15+
LDADD_GTEST = -lgtest -lgtest_main -lgmock -lgmock_main
16+
CFLAGS_COVERAGE = --coverage -fprofile-arcs -ftest-coverage
17+
LDADD_COVERAGE = -lgcov
18+
CFLAGS_ASAN = -fsanitize=address
19+
CFLAGS_TSAN = -fsanitize=thread
20+
CFLAGS_USAN = -fsanitize=undefined
21+
22+
testsdir = /usr/include
23+
24+
tests_HEADERS = /usr/include/gmock/gmock.h
25+
26+
tests_SOURCES = rebootbe_test.cpp \
27+
$(top_srcdir)/rebootbackend/rebootbe.cpp \
28+
reboot_thread_test.cpp \
29+
$(top_srcdir)/rebootbackend/reboot_thread.cpp \
30+
test_main.cpp
31+
32+
tests_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_COVERAGE) $(CFLAGS_SAI)
33+
tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_COVERAGE) $(CFLAGS_SAI)
34+
tests_LDADD = $(LDADD_GTEST) $(LDADD_COVERAGE) -lswsscommon -lpthread \
35+
-lprotobuf $(top_srcdir)/build/gen/librebgnoi.la
36+
37+
tests_asan_SOURCES = $(tests_SOURCES)
38+
tests_asan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_ASAN) $(CFLAGS_SAI)
39+
tests_asan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_ASAN) $(CFLAGS_SAI)
40+
tests_asan_LDFLAGS = $(CFLAGS_ASAN)
41+
tests_asan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf \
42+
$(top_srcdir)/build/gen/librebgnoi.la
43+
44+
45+
tests_tsan_SOURCES = $(tests_SOURCES)
46+
tests_tsan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_TSAN) $(CFLAGS_SAI)
47+
tests_tsan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_TSAN) $(CFLAGS_SAI)
48+
tests_tsan_LDFLAGS = $(CFLAGS_TSAN)
49+
tests_tsan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf \
50+
$(top_srcdir)/build/gen/librebgnoi.la
51+
52+
tests_usan_SOURCES = $(tests_SOURCES)
53+
tests_usan_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_USAN) $(CFLAGS_SAI)
54+
tests_usan_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_USAN) $(CFLAGS_SAI)
55+
tests_usan_LDFLAGS = $(CFLAGS_USAN)
56+
tests_usan_LDADD = $(LDADD_GTEST) -lswsscommon -lpthread -lprotobuf \
57+
$(top_srcdir)/build/gen/librebgnoi.la

0 commit comments

Comments
 (0)