Skip to content

Add yang model unit test for check_up_status field type #11110 #11242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SONiC make file

NOJESSIE ?= 1
NOSTRETCH ?= 0
NOSTRETCH ?= 1
NOBUSTER ?= 0
NOBULLSEYE ?= 0

Expand Down
12 changes: 7 additions & 5 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ endif
ifeq ($(DOCKER_BUILDER_WORKDIR),)
override DOCKER_BUILDER_WORKDIR := "/sonic"
endif

DOCKER_RUN := docker run --rm=true --privileged --init \
HOSTNET := --network=host
DOCKER_RUN := docker run $(HOSTNET) --rm=true --privileged --init \
-v $(DOCKER_BUILDER_MOUNT) \
-v "$(DOCKER_LOCKDIR):$(DOCKER_LOCKDIR)" \
-w $(DOCKER_BUILDER_WORKDIR) \
Expand All @@ -211,6 +211,7 @@ ifneq ($(DOCKER_BUILDER_USER_MOUNT),)
DOCKER_RUN += $(foreach mount,$(subst $(comma), ,$(DOCKER_BUILDER_USER_MOUNT)), $(addprefix -v , $(mount)))
endif

DOCKER_RUN += --mount type=tmpfs,destination=/bld-tmp,tmpfs-mode=1777
ifdef SONIC_BUILD_QUIETER
DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)"
endif
Expand Down Expand Up @@ -307,17 +308,18 @@ DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log
DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log


DOCKER_BASE_BUILD = docker build --no-cache \
DOCKER_AUTH:=docker login -u sonicbrcm -p 4b5d1f28-6f43-41da-a794-88805ee8fc2d
DOCKER_BASE_BUILD = $(DOCKER_AUTH);docker build $(HOSTNET) --no-cache \
-t $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
--build-arg no_proxy=$(no_proxy) \
$(SLAVE_DIR) $(SPLIT_LOG) $(DOCKER_BASE_LOG)

DOCKER_BASE_PULL = docker pull \
DOCKER_BASE_PULL = $(DOCKER_AUTH);docker pull \
$(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)

DOCKER_BUILD = docker build --no-cache \
DOCKER_BUILD = $(DOCKER_AUTH);docker build $(HOSTNET) --no-cache \
--build-arg user=$(USER) \
--build-arg uid=$(shell id -u) \
--build-arg guid=$(shell id -g) \
Expand Down
5 changes: 5 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ TRUSTED_GPG_DIR=$BUILD_TOOL_PATH/trusted.gpg.d
exit 1
}

FILESYSTEM_BASE=/sonic/build
mkdir -p ${FILESYSTEM_BASE}
sudo mount -t tmpfs -o size=16G tmpfs ${FILESYSTEM_BASE}
FILESYSTEM_ROOT=${FILESYSTEM_BASE}/fsroot

## Prepare the file system directory
if [[ -d $FILESYSTEM_ROOT ]]; then
sudo rm -rf $FILESYSTEM_ROOT || die "Failed to clean chroot directory"
Expand Down
8 changes: 4 additions & 4 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# SONIC_CONFIG_BUILD_JOBS - set number of jobs for parallel build.
# Corresponding -j argument will be passed to make command inside docker
# container.
SONIC_CONFIG_BUILD_JOBS = 1
SONIC_CONFIG_BUILD_JOBS = 8

# SONIC_CONFIG_MAKE_JOBS - set number of parallel make jobs per package.
# Corresponding -j argument will be passed to make/dpkg commands that build separate packages
SONIC_CONFIG_MAKE_JOBS = $(shell nproc)
SONIC_CONFIG_MAKE_JOBS = 8

# DEFAULT_BUILD_LOG_TIMESTAMP - add timestamp in build log
# Supported format: simple, none
Expand Down Expand Up @@ -115,8 +115,8 @@ FRR_USER_GID = 300
# rcache : Use cache if exists, but dont update the cache
# cache : Same as rwcache
# SONIC_DPKG_CACHE_SOURCE - Stores the cache location details
SONIC_DPKG_CACHE_METHOD ?= none
SONIC_DPKG_CACHE_SOURCE ?= /var/cache/sonic/artifacts
SONIC_DPKG_CACHE_METHOD ?= cache
SONIC_DPKG_CACHE_SOURCE ?= /projects/csg_sonic/dpkg_cache/community/

# Default VS build memory preparation
DEFAULT_VS_PREPARE_MEM = yes
Expand Down
3 changes: 3 additions & 0 deletions rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,12 @@ define SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR
upperdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
workdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
mergedir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH))
#echo sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
export SONIC_DPKG_ADMINDIR=$$mergedir
trap "sudo umount $$mergedir && rm -rf $$mergedir $$upperdir $$workdir" EXIT
#mergedir=$(echo -n /var/lib/dpkg)
#export SONIC_DPKG_ADMINDIR=/var/lib/dpkg
endef


Expand Down
5 changes: 3 additions & 2 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BULLSEYE_DEBS_PATH = $(TARGET_PATH)/debs/bullseye
BULLSEYE_FILES_PATH = $(TARGET_PATH)/files/bullseye
DBG_IMAGE_MARK = dbg
DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz
DPKG_ADMINDIR_PATH = /sonic/dpkg
DPKG_ADMINDIR_PATH = /bld-tmp

CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic)
PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM)
Expand Down Expand Up @@ -105,7 +105,6 @@ configure :
@mkdir -p $(BULLSEYE_FILES_PATH)
@mkdir -p $(PYTHON_DEBS_PATH)
@mkdir -p $(PYTHON_WHEELS_PATH)
@mkdir -p $(DPKG_ADMINDIR_PATH)
@echo $(PLATFORM) > .platform
@echo $(PLATFORM_ARCH) > .arch

Expand Down Expand Up @@ -883,6 +882,8 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform
$$($$*.gz_PATH)/Dockerfile.j2 \
$(call dpkg_depend,$(TARGET_PATH)/%.gz.dep)
$(HEADER)

docker login -u sonicbrcm -p 4b5d1f28-6f43-41da-a794-88805ee8fc2d

# Load the target deb from DPKG cache
$(call LOAD_CACHE,$*.gz,$@)
Expand Down
2 changes: 1 addition & 1 deletion src/openssh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series

# Build package
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
DEB_BUILD_OPTIONS=" ${DEB_BUILD_OPTIONS} nocheck " dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd

mv $(DERIVED_TARGETS) $* $(DEST)/
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-build-hooks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DEPENDS := $(shell find scripts hooks debian -type f)
$(SONIC_BUILD_HOOKS_TARGET): $(DEPENDS)
@rm -rf $(BUILDINFO_DIR)/$(SONIC_BUILD_HOOKS) $(TMP_DIR)
@mkdir -p $(DEBIAN_DIR) $(SCRIPTS_PATH) $(HOOKS_PATH) $(SYMBOL_LINK_PATH) $(TRUSTED_GPG_PATH) $(BUILDINFO_DIR)
@chmod 0775 $(DEBIAN_DIR)
@chmod 00775 $(DEBIAN_DIR)
@cp debian/* $(DEBIAN_DIR)/
@cp scripts/* $(SCRIPTS_PATH)/
@cp hooks/* $(HOOKS_PATH)/
Expand Down
21 changes: 14 additions & 7 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,8 @@
"has_timer": "False",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "False"
},
"database": {
"auto_restart": "always_enabled",
Expand All @@ -1474,7 +1475,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "always_enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"snmp": {
"auto_restart": "enabled",
Expand All @@ -1483,7 +1485,8 @@
"has_timer": "true",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "true"
},
"swss": {
"auto_restart": "enabled",
Expand All @@ -1492,7 +1495,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"syncd": {
"auto_restart": "enabled",
Expand All @@ -1501,7 +1505,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
"lldp": {
"auto_restart": "enabled",
Expand All @@ -1510,7 +1515,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
"dhcp_relay": {
"auto_restart": "enabled",
Expand All @@ -1519,7 +1525,8 @@
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != 'ToRRouter') %}enabled{% else %}disabled{% endif %}",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "true"
}
},
"DHCP_RELAY": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"has_timer": "False",
"has_global_scope": "True",
"has_per_asic_scope": "True",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "False"
},
{
"name": "swss",
Expand All @@ -19,7 +20,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
{
"name": "syncd",
Expand All @@ -28,7 +30,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "local"
"set_owner": "local",
"check_up_status": "false"
},
{
"name": "snmp",
Expand All @@ -37,7 +40,8 @@
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "false",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
{
"name": "lldp",
Expand All @@ -46,7 +50,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
},
{
"name": "dhcp_relay",
Expand All @@ -55,7 +60,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "kube"
"set_owner": "kube",
"check_up_status": "false"
}
]
}
Expand All @@ -72,7 +78,8 @@
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "invalid"
"set_owner": "invalid",
"check_up_status": "false"
}
]
}
Expand All @@ -88,7 +95,8 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"check_up_status": "false"
}
]
}
Expand All @@ -104,7 +112,8 @@
"auto_restart": "always_enabled",
"has_timer": "FALSE",
"has_global_scope": "TRUE",
"has_per_asic_scope": "TRUE"
"has_per_asic_scope": "TRUE",
"check_up_status": "FALSE"
}
]
}
Expand Down