Skip to content
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

Test manager installation from sources #2558

Open
davidjiglesias opened this issue Feb 8, 2022 · 0 comments
Open

Test manager installation from sources #2558

davidjiglesias opened this issue Feb 8, 2022 · 0 comments

Comments

@davidjiglesias
Copy link
Member

davidjiglesias commented Feb 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants