saltstack-formulas / zabbix-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
50 stars 121 forks source link

[Kitchen] Problems with testing CentOS #137

Open myii opened 4 years ago

myii commented 4 years ago

Made some attempts to get the CentOS testing working again but ran into a number of hurdles.

centos-6

This was actually working as-is a few months back for version: '4.4:

The zabbix-server-mysql package is no longer available in the repo:

The highest version that still has it available is 2.4 (this isn't really useful, though):

centos-7 & centos-8

Essentially, these are failing due to issues between docker and systemd. The main error that reoccurs:

New main PID does not belong to service, and PID file is not owned by root. Refusing.

Research:

Potential solutions

  1. Check if we're in a container and then run the service manually instead, using a check similar to:
    1. https://github.com/saltstack-formulas/ntp-formula/pull/45
  2. Use Vagrant boxes instead:
    1. Biggest issue here is that this will only be local testing, which is always difficult to work with.
an0nz commented 3 years ago

For my own kitchen tests I got around this issue thanks to this issue https://github.com/apache/bigtop/pull/640 If you mount cgroups in as a volume to your test container services can run as non-root users. eg: /sys/fs/cgroup:/sys/fs/cgroup:ro

For Kitchen I used the following as I only test for OS's where this is needed but the same driver_config can be set in the platforms definition if you need it on specific images.

suites:
  - name: build
    driver_config:
      volume: 
        - /sys/fs/cgroup:/sys/fs/cgroup:ro

I do not use this formula so haven't tested to see if it fixes the problem just thought it might be relevant as I came across this bug while hunting for something to fix the same issue in my own salt repos.