opensvc
6 months agoMerge pull request #71 from cvaroqui/master master
Christophe Varoqui [Mon, 2 Mar 2020 14:07:20 +0000 (15:07 +0100)]
Merge pull request #71 from cvaroqui/master

Ensure docker/podman --dns-option are set to minimal requirements

6 months agoFix podman dns options settings
Christophe Varoqui [Mon, 2 Mar 2020 13:58:24 +0000 (14:58 +0100)]
Fix podman dns options settings

podman run accepts --dns-opt, and not --dns-option like docker.

6 months agoEnsure docker/podman --dns-option are set to minimal requirements
Christophe Varoqui [Mon, 2 Mar 2020 13:45:32 +0000 (14:45 +0100)]
Ensure docker/podman --dns-option are set to minimal requirements

* ndots >= 2 (support for flex instance name lookup <nodename>.<svcname>)
* edns0 enabled (support for large resultset)

6 months agoMerge pull request #70 from cvaroqui/master
Christophe Varoqui [Sun, 1 Mar 2020 19:47:21 +0000 (20:47 +0100)]
Merge pull request #70 from cvaroqui/master

Fix the test for registration keys count

6 months agoFix the test for registration keys count
Christophe Varoqui [Sun, 1 Mar 2020 18:47:24 +0000 (19:47 +0100)]
Fix the test for registration keys count

Increment the registered counter instead of resetting it for each disk.
And pass a list to mangle_devs() instead of a string.

6 months agoMerge pull request #69 from cvaroqui/master
Christophe Varoqui [Sun, 1 Mar 2020 09:35:53 +0000 (10:35 +0100)]
Merge pull request #69 from cvaroqui/master

Fix the scsireserv registered count for multi-lun resources

6 months agoFix the scsireserv registered count for multi-lun resources
Christophe Varoqui [Sun, 1 Mar 2020 09:22:13 +0000 (10:22 +0100)]
Fix the scsireserv registered count for multi-lun resources

Example:

With 1 registration down on 1/2 luns, we reported 1/4 instead of 3/4

root@ringfs-1:/opt/opensvc# om test/svc/svc100 print status -r
test/svc/svc100                   warn       warn
`- instances
   `- ringfs-1                    warn       warn, frozen, idle
      |- disk#0          ........ down       vg svc100.test.svc.ringfs
      `- disk#0pr        ........ warn       /dev/sde, /dev/sdh, /dev/sdp, /dev/sds
                                             warn: 1/4 paths registered

6 months agoMerge pull request #68 from cvaroqui/master
Christophe Varoqui [Sat, 29 Feb 2020 07:49:57 +0000 (08:49 +0100)]
Merge pull request #68 from cvaroqui/master

Dorado array and pool drivers

6 months agoFix pylint reported errors
Christophe Varoqui [Sat, 29 Feb 2020 07:42:42 +0000 (08:42 +0100)]
Fix pylint reported errors

6 months agoMerge branch 'master' of github.com:opensvc/opensvc
Christophe Varoqui [Sat, 29 Feb 2020 00:20:52 +0000 (01:20 +0100)]
Merge branch 'master' of github.com:opensvc/opensvc

6 months agoAdd the Huawei Dorado array and pool drivers
Christophe Varoqui [Sat, 29 Feb 2020 00:17:05 +0000 (01:17 +0100)]
Add the Huawei Dorado array and pool drivers

If the hypermetrodomain keyword is set in the pool configuration, the
volumes created by this pool use a hypermetro replicated lun pair. In this
case, the array keyword must be scoped to reflect node-to-array affinities.

Else, a simple lun is created.

6 months agoHandle path returning "Not ready" scsi errors on scsi3 pr inquiries
Christophe Varoqui [Sat, 29 Feb 2020 00:08:04 +0000 (01:08 +0100)]
Handle path returning "Not ready" scsi errors on scsi3 pr inquiries

Huawei Dorado and EMC SRDF Metro set the paused member lun of the
replication set in such a mode.

In this case, we still want to be able to prstop and successfully stop a
service instance, so these errors must be ignored.

Still log warnings about this situation.

Also warn in resource status when the number of registered paths does not
match the number of paths.

6 months agoAlways run configure() after create_disk()
Christophe Varoqui [Sat, 29 Feb 2020 00:01:59 +0000 (01:01 +0100)]
Always run configure() after create_disk()

Even if exposed_devs() already resolves to something.
Because the wait for devices logic should never be skiped after create_disk().

6 months agoAdd --nodes option to "om pool create volume"
Christophe Varoqui [Fri, 28 Feb 2020 16:36:25 +0000 (17:36 +0100)]
Add --nodes option to "om pool create volume"

The create_volume() Pool object method supports that kwarg, so better to
expose it.

6 months agoLog the scanscsi actions instead of printing them
Christophe Varoqui [Fri, 28 Feb 2020 16:34:09 +0000 (17:34 +0100)]
Log the scanscsi actions instead of printing them

Which helps post mortem troubleshoot.

6 months agoFix the scoped disk_id settings in disk.disk provisionning codepath
Christophe Varoqui [Fri, 28 Feb 2020 16:25:39 +0000 (17:25 +0100)]
Fix the scoped disk_id settings in disk.disk provisionning codepath

Which was setting 'disk#1@node1.disk_id' instead of 'disk#1.disk_id@node1'

6 months agoFix duplicated r1_result in the sym create disk returned dataset
Christophe Varoqui [Fri, 28 Feb 2020 16:24:20 +0000 (17:24 +0100)]
Fix duplicated r1_result in the sym create disk returned dataset

6 months agoFix the daemon unlock handler call parameters
Christophe Varoqui [Fri, 28 Feb 2020 16:21:46 +0000 (17:21 +0100)]
Fix the daemon unlock handler call parameters

The handler expects 'lock_id' instead of 'id' in options.

6 months agoFix the "om array" command wrapper Array object lookup by name
Christophe Varoqui [Fri, 28 Feb 2020 16:20:21 +0000 (17:20 +0100)]
Fix the "om array" command wrapper Array object lookup by name

6 months agoChange the "om pool create volume" default behaviour to fmt=True
Christophe Varoqui [Fri, 28 Feb 2020 15:47:11 +0000 (16:47 +0100)]
Change the "om pool create volume" default behaviour to fmt=True

So it is aligned with the volume resource provisionner behaviour: a volume
contains a filesystem, unless specified otherwise.

6 months agoFix daemon lock acquire from unix socket
Christophe Varoqui [Fri, 28 Feb 2020 15:45:13 +0000 (16:45 +0100)]
Fix daemon lock acquire from unix socket

In this case, the requester nodename is None, which the lock_acquire()
handler method should interpret as the local node name.

6 months agoMerge pull request #66 from cgalibern/master
cgalibern [Fri, 28 Feb 2020 09:59:03 +0000 (10:59 +0100)]
Merge pull request #66 from cgalibern/master

[Test] Ensure 'sec' and 'cfg' objects accept camelCase keys

7 months agoTest sec and cfg accept camelCase keys
Cyril Galibern [Fri, 21 Feb 2020 12:11:05 +0000 (13:11 +0100)]
Test sec and cfg accept camelCase keys

7 months agoMerge pull request #65 from cgalibern/master
cgalibern [Fri, 21 Feb 2020 09:34:38 +0000 (10:34 +0100)]
Merge pull request #65 from cgalibern/master

Tox include slow tests and add py35

7 months agoTox include slow tests and add py35
Cyril Galibern [Fri, 21 Feb 2020 08:22:03 +0000 (09:22 +0100)]
Tox include slow tests and add py35

7 months agoMerge pull request #64 from cgalibern/master
cgalibern [Thu, 20 Feb 2020 16:06:20 +0000 (17:06 +0100)]
Merge pull request #64 from cgalibern/master

Add tox config

7 months agoAdd tox config
Cyril Galibern [Thu, 20 Feb 2020 14:56:27 +0000 (15:56 +0100)]
Add tox config

It need install tox 'pip install tox'

then run:
  # for parallel run
  tox --parallel auto
or
  tox

7 months agoMerge pull request #63 from cgalibern/master
cgalibern [Thu, 20 Feb 2020 12:59:20 +0000 (13:59 +0100)]
Merge pull request #63 from cgalibern/master

Fix 'print status' errors when terminal columns are too low

7 months agoFix 'print status' errors when terminal columns are too low
Cyril Galibern [Thu, 20 Feb 2020 11:21:08 +0000 (12:21 +0100)]
Fix 'print status' errors when terminal columns are too low

We do our best to detect correct terminal column value,
with 78 as minimum value.

environment variable COLUMNS will be used when stty method fails.

Error example when terminal detected columns was 0:
   $ om svcname print status
   invalid width -4 (must be > 0)

7 months agoTest cleanup travis
Cyril Galibern [Thu, 20 Feb 2020 11:13:04 +0000 (12:13 +0100)]
Test cleanup travis

7 months agoMerge pull request #62 from cvaroqui/master
cgalibern [Thu, 20 Feb 2020 11:47:56 +0000 (12:47 +0100)]
Merge pull request #62 from cvaroqui/master

misc enhancements

7 months agoPOST /wake_monitor enhancement
Christophe Varoqui [Thu, 20 Feb 2020 10:51:13 +0000 (11:51 +0100)]
POST /wake_monitor enhancement

Add parameters:

* immediate, boolean, default False
* reason, string, default None

And set immediate=True from Node::wake_monitor and Svc::wake_monitor, so the
instance and node status change are discovered asap, avoiding ligering
"starting", "stopping", ... smon and nmon state after the action is actually
finished.

7 months agoFix udevadm hardcoded fullpath
Christophe Varoqui [Thu, 20 Feb 2020 10:37:30 +0000 (11:37 +0100)]
Fix udevadm hardcoded fullpath

Ubuntu 19.10 moved udevadm from /sbin to /bin.
Don't hardcode the full path.

7 months agoMerge pull request #61 from cgalibern/master
cgalibern [Wed, 19 Feb 2020 19:27:11 +0000 (20:27 +0100)]
Merge pull request #61 from cgalibern/master

Improve detection of osvcd process

7 months agoImprove detection of osvcd process
Cyril Galibern [Wed, 19 Feb 2020 14:33:25 +0000 (15:33 +0100)]
Improve detection of osvcd process

This should allow again tests in gitlab ci or travis for nodemgr_daemon

It requires:
 o procps for ps -p ... -o args=
 o need sudo for is_container()
   PermissionError: [Errno 13] Permission denied: '/proc/1/environ'

7 months agoTest: don't create node.Node() when loading test files
Cyril Galibern [Wed, 19 Feb 2020 13:44:51 +0000 (14:44 +0100)]
Test: don't create node.Node() when loading test files

This prevent initialize log

7 months agoMerge pull request #60 from arnaudveron/master
cgalibern [Wed, 19 Feb 2020 15:04:13 +0000 (16:04 +0100)]
Merge pull request #60 from arnaudveron/master

Fix relay query when --node option is not set

7 months agoFix relay query when --node option is not set
Arnaud Veron [Wed, 19 Feb 2020 13:56:42 +0000 (14:56 +0100)]
Fix relay query when --node option is not set

om node daemon relay status --server raw://relay.opensvc.com

7 months agoMerge pull request #59 from cgalibern/master
cgalibern [Tue, 18 Feb 2020 17:12:42 +0000 (18:12 +0100)]
Merge pull request #59 from cgalibern/master

fix regression on windows osvcd launch

7 months agoFix regression on osvc_windservice lock usage
Cyril Galibern [Tue, 18 Feb 2020 15:06:25 +0000 (16:06 +0100)]
Fix regression on osvc_windservice lock usage

regression commit id: 54359d0ab90463829080ea84b8faab6bb0255143

7 months agoUpdate daemon process detection and prevent multiple run
Cyril Galibern [Tue, 18 Feb 2020 14:42:07 +0000 (15:42 +0100)]
Update daemon process detection and prevent multiple run

o prevent risk of multiple daemon running in //
  when daemon is starting it:
   verify pid process (from previous run is not osvcd)
   lock to update pidfile with current pid
   run daemon if lock is aquired

o reduce lock time lock is available

o increase pytest timeout for slow tests or use pytest -m 'not slow'

o add tests for daemon start/stop/restart/running/status

o add tests for osvcd:
  o TestDaemonRun::test_refuse_to_run_when_daemon_process_is_already_running
  o TestDaemonRun::test_refuse_to_run_when_osvcd_lock_is_held
  o TestDaemonRun::test_run_loop_forever

7 months agoUpdate daemon process detection and prevent multiple run
Cyril Galibern [Tue, 18 Feb 2020 13:50:31 +0000 (14:50 +0100)]
Update daemon process detection and prevent multiple run

o prevent risk of multiple daemon running in //
  when daemon is starting it:
   verify pid process (from previous run is not osvcd)
   lock to update pidfile with current pid
   run daemon if lock is aquired

o reduce lock time lock is available

o increase pytest timeout for slow tests or use pytest -m 'not slow'

o add tests for daemon start/stop/restart/running/status

o add tests for osvcd:
  o TestDaemonRun::test_refuse_to_run_when_daemon_process_is_already_running
  o TestDaemonRun::test_refuse_to_run_when_osvcd_lock_is_held
  o TestDaemonRun::test_run_loop_forever

7 months agoTest: refacto move mock_argv() fixture to conftest.py
Cyril Galibern [Tue, 18 Feb 2020 10:03:39 +0000 (11:03 +0100)]
Test: refacto move mock_argv() fixture to conftest.py

7 months agoTest: make tests pass on Solaris
Cyril Galibern [Tue, 18 Feb 2020 09:57:12 +0000 (10:57 +0100)]
Test: make tests pass on Solaris

7 months agoTest: Fix lock test on Solaris
Cyril Galibern [Mon, 17 Feb 2020 15:10:47 +0000 (16:10 +0100)]
Test: Fix lock test on Solaris

Solaris lock is process file lock, not process fd lock

7 months agoTest: Allow test_fs flag on Solaris
Cyril Galibern [Mon, 17 Feb 2020 14:50:57 +0000 (15:50 +0100)]
Test: Allow test_fs flag on Solaris

7 months agoMerge pull request #58 from cvaroqui/master
cgalibern [Mon, 17 Feb 2020 13:04:56 +0000 (14:04 +0100)]
Merge pull request #58 from cvaroqui/master

Misc fixes

7 months agoSimplify the logger setup in svcBuilder
Christophe Varoqui [Fri, 14 Feb 2020 16:53:55 +0000 (17:53 +0100)]
Simplify the logger setup in svcBuilder

We no longer need to compute the max svcname length.

7 months agoRemove daemon lock testing for wake_monitor() codepaths
Christophe Varoqui [Fri, 14 Feb 2020 16:51:32 +0000 (17:51 +0100)]
Remove daemon lock testing for wake_monitor() codepaths

Now that ECONNREFUSED is no longer a retryable socket error, it is no longer
needed to detected the daemon running state using the daemon lock.

Also use EPIPE instead of hardcoding the errno integer in the Node object.

7 months agoBe more tolerant of locking conflict on osvcd startup
Christophe Varoqui [Fri, 14 Feb 2020 16:49:49 +0000 (17:49 +0100)]
Be more tolerant of locking conflict on osvcd startup

10 tries, 0.1s delay instead of 1 try.

Because a lock tester can hold the lock during daemon startup.

7 months agoDo not open() lock files with O_TRUNC
Christophe Varoqui [Fri, 14 Feb 2020 16:48:50 +0000 (17:48 +0100)]
Do not open() lock files with O_TRUNC

The lock() codepath uses ftruncate() before writing anyway.

7 months agoAccept formatting a local instance status when the daemon is down
Christophe Varoqui [Fri, 14 Feb 2020 16:47:59 +0000 (17:47 +0100)]
Accept formatting a local instance status when the daemon is down

7 months agoMerge pull request #56 from cvaroqui/master
Christophe Varoqui [Fri, 14 Feb 2020 07:34:13 +0000 (08:34 +0100)]
Merge pull request #56 from cvaroqui/master

Allow Uppercase in config file keys

7 months agoFix hb stack in _configure() error path
Christophe Varoqui [Fri, 14 Feb 2020 07:09:30 +0000 (08:09 +0100)]
Fix hb stack in _configure() error path

Stacked when trying to log configure exception, complaining exc was not
defined. Use a variable outside the iterator to store the exception
catched inside the iterator.

And fix some pylint warnings.

7 months agoAllow Uppercase in config file keys
Christophe Varoqui [Wed, 12 Feb 2020 08:46:46 +0000 (09:46 +0100)]
Allow Uppercase in config file keys

At least data section needs to store keys in secrets and configmaps respecting
user-intended naming (like file names and path).

7 months agoMerge pull request #53 from cgalibern/master
cgalibern [Wed, 12 Feb 2020 07:27:38 +0000 (08:27 +0100)]
Merge pull request #53 from cgalibern/master

Fix RETRYABLE list with errno values

7 months agoDon't retry send actions to daemon when ECONNREFUSED
Cyril Galibern [Tue, 11 Feb 2020 17:39:33 +0000 (18:39 +0100)]
Don't retry send actions to daemon when ECONNREFUSED

fix #54

This prevent start service on SunOS node when daemon socket exists but daemon is not running.

7 months agoFix RETRYABLE list with errno values
Cyril Galibern [Mon, 10 Feb 2020 22:44:48 +0000 (23:44 +0100)]
Fix RETRYABLE list with errno values

This will ensure same logic for different Os

7 months agoMerge pull request #55 from cvaroqui/master
Christophe Varoqui [Wed, 12 Feb 2020 06:27:48 +0000 (07:27 +0100)]
Merge pull request #55 from cvaroqui/master

Fix a stack sorting fs.dir and fs.flag resources in the same object

7 months agoFix a stack sorting fs.dir and fs.flag resources in the same object
Christophe Varoqui [Wed, 12 Feb 2020 06:17:43 +0000 (07:17 +0100)]
Fix a stack sorting fs.dir and fs.flag resources in the same object

Catch AttributeError from resFs __lt__ when comparing mount_point attrs, as
this attribute may not exist in all fs drivers (ex: fs.flag).

Resync the resFsDir __lt__ definition from resFs.

Do not return the first fs resource mount point as the volume mount point, as
the first fs resource might not have a mount_point attribute. Return the
mount point of the first fs resource with a mount_point attribute instead.

7 months agoDon't retry send actions to daemon when ECONNREFUSED
Cyril Galibern [Tue, 11 Feb 2020 17:39:33 +0000 (18:39 +0100)]
Don't retry send actions to daemon when ECONNREFUSED

fix #54

This prevent start service on SunOS node when daemon socket exists but daemon is not running.

7 months agoFix RETRYABLE list with errno values
Cyril Galibern [Mon, 10 Feb 2020 22:44:48 +0000 (23:44 +0100)]
Fix RETRYABLE list with errno values

This will ensure same logic for different Os

7 months agoMerge pull request #52 from cgalibern/master
cgalibern [Mon, 10 Feb 2020 13:16:29 +0000 (14:16 +0100)]
Merge pull request #52 from cgalibern/master

test fs-flag, add build-status badge in readme

7 months agoAdd build status to README
Cyril Galibern [Mon, 10 Feb 2020 12:31:39 +0000 (13:31 +0100)]
Add build status to README

7 months agoPep8 resData.py
Cyril Galibern [Sat, 8 Feb 2020 18:03:33 +0000 (19:03 +0100)]
Pep8 resData.py

7 months agoTests: Ensure fs flag filename is correct
Cyril Galibern [Wed, 5 Feb 2020 13:22:35 +0000 (14:22 +0100)]
Tests: Ensure fs flag filename is correct

7 months agoMerge pull request #50 from cvaroqui/master
Christophe Varoqui [Sun, 9 Feb 2020 02:48:40 +0000 (03:48 +0100)]
Merge pull request #50 from cvaroqui/master

Don't start/stop task.type=oci containers on start/stop

7 months agoDon't start/stop task.type=oci containers on start/stop
Christophe Varoqui [Sun, 9 Feb 2020 02:38:59 +0000 (03:38 +0100)]
Don't start/stop task.type=oci containers on start/stop

Use the resTask start/stop method instead of the resContainer implementation.

As the resTaskDocker class inherits from the resTask and the resContainerDocker
driver, explicitely choose the start/stop implementation to use.

7 months agoClassify "enter" as a no-lock action
Christophe Varoqui [Sat, 8 Feb 2020 09:14:06 +0000 (10:14 +0100)]
Classify "enter" as a no-lock action

So multiple enter can run in parallel.

7 months agoMerge pull request #48 from cvaroqui/master
Christophe Varoqui [Sat, 8 Feb 2020 06:37:39 +0000 (07:37 +0100)]
Merge pull request #48 from cvaroqui/master

Fix a monitor thread stack triggered when a lot of objects are being …

7 months agoAdd the "enter --rid <rid>" action
Christophe Varoqui [Sat, 8 Feb 2020 06:26:34 +0000 (07:26 +0100)]
Add the "enter --rid <rid>" action

Implement for docker and podman first.
Detect a shell in the container and execute interactively with a tty.
This action avoids having to use "oci exec -it {n} bash" syntax.

Also add a GET /object_enter api handler, launching a singe-use gotty server,
with random creds, random port and random path. A browser has then a few
seconds to connect before it dies.

7 months agoFix a monitor thread stack triggered when a lot of objects are being deleted
Christophe Varoqui [Fri, 7 Feb 2020 08:20:18 +0000 (09:20 +0100)]
Fix a monitor thread stack triggered when a lot of objects are being deleted

Traceback (most recent call last):
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 151, in run
    self.do()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 223, in do
    self.orchestrator()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 785, in orchestrator
    self.sync_services_conf()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 237, in sync_services_conf
    confs = self.get_services_configs()
  File "/usr/share/opensvc/lib/osvcd_mon.py", line 2706, in get_services_configs
    for path, config in configs.items():
RuntimeError: dictionary changed size during iteration

7 months agoMerge pull request #47 from cvaroqui/master
Christophe Varoqui [Wed, 5 Feb 2020 14:33:17 +0000 (15:33 +0100)]
Merge pull request #47 from cvaroqui/master

Fix an issue in event delivery to clients

7 months agoFix an issue in event delivery to clients
Christophe Varoqui [Wed, 5 Feb 2020 14:24:49 +0000 (15:24 +0100)]
Fix an issue in event delivery to clients

In a fast succession of events, a n+1 event could overwrite the n event data
for a client.

Make a copy of the dequeue event before putting the copy in the client queue,
to avoid being replaced while queued.

7 months agoMerge pull request #46 from cvaroqui/master
Christophe Varoqui [Wed, 5 Feb 2020 08:41:11 +0000 (09:41 +0100)]
Merge pull request #46 from cvaroqui/master

Allow forwarding to the opensvc backend networks

7 months agoAllow forwarding to the opensvc backend networks
Christophe Varoqui [Wed, 5 Feb 2020 08:33:16 +0000 (09:33 +0100)]
Allow forwarding to the opensvc backend networks

docker setting the FORWARD chain default policy to DROP, we need to allow
opensvc backend networks.

Use the following pair of rules per net:

-A FORWARD -i obr_net1 -m comment --comment "name: net1" -j ACCEPT
-A FORWARD -o obr_net1 -m comment --comment "name: net1" -j ACCEPT

7 months agoMerge pull request #45 from cgalibern/master
cgalibern [Tue, 4 Feb 2020 18:15:32 +0000 (19:15 +0100)]
Merge pull request #45 from cgalibern/master

Improve tests & small refacto on lock lib

7 months agoAdd opensvc.iml to git ignored files
Cyril Galibern [Tue, 4 Feb 2020 16:37:13 +0000 (17:37 +0100)]
Add opensvc.iml to git ignored files

7 months agoFix lock creation failure when lock directory doesn't exist
Cyril Galibern [Tue, 4 Feb 2020 16:32:50 +0000 (17:32 +0100)]
Fix lock creation failure when lock directory doesn't exist

7 months agoApply pep8 style to lock.py
Cyril Galibern [Tue, 4 Feb 2020 16:01:06 +0000 (17:01 +0100)]
Apply pep8 style to lock.py

7 months agoTests: tests lock lib
Cyril Galibern [Tue, 4 Feb 2020 15:59:35 +0000 (16:59 +0100)]
Tests: tests lock lib

o lib/tests/test_lock.py:
 o TestLockUnlock::test_lock_unlock[0]
 o TestLockUnlock::test_lock_unlock[1]
 o TestLockUnlock::test_lock_unlock[2]
 o TestLockUnlock::test_lock_unlock[3]
 o TestLockUnlock::test_lock_unlock[4]
 o TestLockUnlock::test_lock_unlock[5]
 o TestLockUnlock::test_lock_unlock[6]
 o TestLockUnlock::test_lock_unlock[7]
 o TestLockUnlock::test_lock_unlock[8]
 o TestLockUnlock::test_lock_unlock[9]
 o TestLockUnlock::test_can_lock_again[0]
 o TestLockUnlock::test_can_lock_again[1]
 o TestLockUnlock::test_can_lock_again[2]
 o TestLockUnlock::test_can_lock_again[3]
 o TestLockUnlock::test_can_lock_again[4]
 o TestLockUnlock::test_can_lock_again[5]
 o TestLockUnlock::test_can_lock_again[6]
 o TestLockUnlock::test_can_lock_again[7]
 o TestLockUnlock::test_can_lock_again[8]
 o TestLockUnlock::test_can_lock_again[9]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[0]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[1]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[2]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[3]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[4]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[5]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[6]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[7]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[8]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid[9]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[0]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[1]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[2]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[3]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[4]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[5]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[6]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[7]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[8]
 o TestLockUnlock::test_lock_raise_lock_timeout_if_held_by_another_pid_real_multiprocess[9]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[0]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[1]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[2]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[3]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[4]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[5]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[6]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[7]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[8]
 o TestCmlock::test_try_x_times_to_get_lock_until_it_acquires_lock[9]
 o TestCmlock::test_no_run_x_acquired_fails[0]
 o TestCmlock::test_no_run_x_acquired_fails[1]
 o TestCmlock::test_no_run_x_acquired_fails[2]
 o TestCmlock::test_no_run_x_acquired_fails[3]
 o TestCmlock::test_no_run_x_acquired_fails[4]
 o TestCmlock::test_no_run_x_acquired_fails[5]
 o TestCmlock::test_no_run_x_acquired_fails[6]
 o TestCmlock::test_no_run_x_acquired_fails[7]
 o TestCmlock::test_no_run_x_acquired_fails[8]
 o TestCmlock::test_no_run_x_acquired_fails[9]
 o TestLockExceptions::test_timeout_exc
 o TestLockExceptions::test_acquire_exc

7 months agoTest: refacto mgr tests
Cyril Galibern [Tue, 4 Feb 2020 12:48:37 +0000 (13:48 +0100)]
Test: refacto mgr tests

7 months agoTests: tests config with lvm service
Cyril Galibern [Tue, 4 Feb 2020 12:47:30 +0000 (13:47 +0100)]
Tests: tests config with lvm service

o lib/tests/test_svc.py::TestSvcWithDiskLvm
  o has disk vg resource
  o disk resource is optional by default
  o has no disk pr resource
  o disk resource set optional from config
  o automatic define disk pr
  o disk pr is non optional by default
  o disk pr set optional from config

7 months agoMerge pull request #44 from cvaroqui/master
Christophe Varoqui [Tue, 4 Feb 2020 04:26:35 +0000 (05:26 +0100)]
Merge pull request #44 from cvaroqui/master

Redirect "om <secpath> ed" to edit config

7 months agoRedirect "om <secpath> ed" to edit config
Christophe Varoqui [Tue, 4 Feb 2020 04:17:09 +0000 (05:17 +0100)]
Redirect "om <secpath> ed" to edit config

The "ed" action is now entering the Data::edit() codepath, which fail because
no key is set in options.

Instead of failing, redirect to Data::edit_config(), which is the codepath
that was entered before the "edit --key <k>" action was added.

7 months agoMerge pull request #43 from cvaroqui/master
Christophe Varoqui [Mon, 3 Feb 2020 01:37:38 +0000 (02:37 +0100)]
Merge pull request #43 from cvaroqui/master

2 fixes for print status displayed information

7 months agoUse a more coherent display name for parents and children in print status output
Christophe Varoqui [Mon, 3 Feb 2020 01:30:06 +0000 (02:30 +0100)]
Use a more coherent display name for parents and children in print status output

Use fully qualified svcpath if no namespace is locked, else use the stripped
svcpath.

7 months agoFix "undef" status of parents in print status output
Christophe Varoqui [Mon, 3 Feb 2020 01:06:45 +0000 (02:06 +0100)]
Fix "undef" status of parents in print status output

This issue happens when a parent is defined as a short svcname, implicitely
relative to the child namespace.

Use resolve_path() on defined parents when adding them to the selector used
to fetch monitor data.

7 months agoMerge pull request #42 from cvaroqui/master
Christophe Varoqui [Sun, 2 Feb 2020 06:36:54 +0000 (07:36 +0100)]
Merge pull request #42 from cvaroqui/master

Fix "om mon" showing out of current namespace objects

7 months agoFix "om mon" showing out of current namespace objects
Christophe Varoqui [Sun, 2 Feb 2020 06:21:16 +0000 (07:21 +0100)]
Fix "om mon" showing out of current namespace objects

The "daemon_status" and "events" api handlers accept the namespace option,
but "om mon" did not set this option.

This patch adds the namespace kwarg to the Node::_daemon_status() and Node::
daemon_events() methods, and use that new kwarg in calls from svcmon.

7 months agoMerge pull request #37 from cgalibern/master
cgalibern [Sat, 1 Feb 2020 09:22:37 +0000 (10:22 +0100)]
Merge pull request #37 from cgalibern/master

Improve tests & implement fs.flag resource driver for SunOS

7 months agoTest: run pytest before pylint to have earlier failure status
Cyril Galibern [Sat, 1 Feb 2020 09:17:30 +0000 (10:17 +0100)]
Test: run pytest before pylint to have earlier failure status

7 months agoSet can_rollback on successful start in the fs.flag driver
Cyril Galibern [Sat, 1 Feb 2020 09:13:01 +0000 (10:13 +0100)]
Set can_rollback on successful start in the fs.flag driver

pickup from commit; a79c01ac27d16e414eaf50210682d28cbf8fdd8b

7 months agoAdd fs.flag resource driver for SunOS
Cyril Galibern [Fri, 31 Jan 2020 19:17:01 +0000 (20:17 +0100)]
Add fs.flag resource driver for SunOS

7 months agoReformat mgr.py
Cyril Galibern [Fri, 31 Jan 2020 17:32:28 +0000 (18:32 +0100)]
Reformat mgr.py

7 months agoAdd service actions (Tests)
Cyril Galibern [Fri, 31 Jan 2020 17:22:10 +0000 (18:22 +0100)]
Add service actions (Tests)

Service tests are done on Linux, SunOS, Darwin, FreeBSD, HP-UX, OSF1

Resource fs with type 'flag' only tested on Linux

collected 31 items
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithoutPrivs::test_no_call_to_main_and_exit_1[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_wrong_action_exit_1[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_print_config_json[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[Linux] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[SunOS] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[Darwin] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[FreeBSD] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[HP-UX] PASSED
o lib/tests/test_mgr.py::TestServiceActionWithPriv::test_create_call_node_create_service[OSF1] PASSED
o lib/tests/test_mgr.py::TestServiceActionFsFlagWithPriv::test_create_service_with_fs_flag_then_verify_config[Linux] PASSED

7 months agoTests: use capture_stdout fixture
Cyril Galibern [Fri, 31 Jan 2020 16:41:28 +0000 (17:41 +0100)]
Tests: use capture_stdout fixture

7 months agoTest Linux fs driver honoring the "umount fs with io err" policy
Cyril Galibern [Tue, 28 Jan 2020 21:39:04 +0000 (22:39 +0100)]
Test Linux fs driver honoring the "umount fs with io err" policy

7 months agoMerge pull request #41 from cvaroqui/master
Christophe Varoqui [Sat, 1 Feb 2020 04:48:54 +0000 (05:48 +0100)]
Merge pull request #41 from cvaroqui/master

Fix the cfg objects add --from <dir> path walking algorithm

7 months agoFix the cfg objects add --from <dir> path walking algorithm
Christophe Varoqui [Sat, 1 Feb 2020 04:41:51 +0000 (05:41 +0100)]
Fix the cfg objects add --from <dir> path walking algorithm

os.walk() already recurse subdirs for us, no need to recurse ourselves.