wazuh-qa icon indicating copy to clipboard operation
wazuh-qa copied to clipboard

Test manager installation from sources

Open davidjiglesias opened this issue 3 years ago • 0 comments

We need a new test for the Wazuh installation using sources.

With some of the changes introduced in Wazuh v4.2.0, the embedded python is no longer compiled and installed during the Wazuh manager installation from sources. Instead, the python package is already pre-installed and the installation package or the install.sh script only decompress it during the installation.

However, Wazuh still supports a complete installation from sources. This can occur in 2 different situations, as we can observe from the MAKEFILE:

ifeq (,$(filter ${PYTHON_SOURCE},YES yes y Y 1))
ifneq (,$(PRECOMPILED_RES))
external/$(CPYTHON).tar.gz: external-precompiled/$(CPYTHON).tar.gz
	test -e $(patsubst %.gz,%,$@) ||\
	($(CURL) $@ $(RESOURCES_URL)/libraries/sources/$(patsubst external/%,%,$@) &&\
	cd external && $(GUNZIP) $(patsubst external/%,%,$@) && $(TAR) $(patsubst external/%.gz,%,$@) && rm $(patsubst external/%.gz,%,$@))
	test -d $(patsubst %.tar.gz,%,$@) || (cd external && $(GZIP) $(patsubst external/%.gz,%,$@))

external-precompiled/$(CPYTHON).tar.gz:
	-$(CURL) external/$(patsubst external-precompiled/%,%,$@) $(RESOURCES_URL)/libraries/$(PRECOMPILED_RES)/$(patsubst external-precompiled/%,%,$@) || true
	-cd external && test -e $(patsubst external-precompiled/%,%,$@) && $(GUNZIP) $(patsubst external-precompiled/%,%,$@) || true
else
external/$(CPYTHON).tar.gz:
	$(CURL) $@ $(RESOURCES_URL)/libraries/sources/$(patsubst external/%,%,$@)
	cd external && $(GUNZIP) $(patsubst external/%,%,$@)
	cd external && $(TAR) $(patsubst external/%.gz,%,$@)
	rm $(patsubst %.gz,%,$@)
endif
else
external/$(CPYTHON).tar.gz:
	$(CURL) $@ $(RESOURCES_URL)/libraries/sources/$(patsubst external/%,%,$@)
	cd external && $(GUNZIP) $(patsubst external/%,%,$@)
	cd external && $(TAR) $(patsubst external/%.gz,%,$@)
	rm $(patsubst %.gz,%,$@)
endif
  1. If the compilation option PYTHON_SOURCE, which defaults to False, is set to True
  2. If the PRECOMPILED_RES variable is empty (this occurs when OS and ARCH cannot be properly read, as stated in PRECOMPILED_RES := $(PRECOMPILED_OS)$(PRECOMPILED_ARCH)

For such reason, we should develop a test for said installation process.

davidjiglesias avatar Feb 08 '22 16:02 davidjiglesias