Skip to content
Snippets Groups Projects
  1. Sep 11, 2008
    • Guido Trotter's avatar
      LockSet: forbid add() on a partially owned set · d2aff862
      Guido Trotter authored
      This patch bans add() on a half-acquired set. This behavior was
      previously possible, but created a deadlock if someone tried to acquire
      the set-lock in the meantime, and thus is now forbidden. The
      testAddRemove unit test is fixed for this new behavior, and includes a
      few more lines of testing and a new testConcurrentSetLockAdd function
      tests its behavior in the concurrent case.
      
      Reviewed-by: imsnah
      d2aff862
    • Guido Trotter's avatar
      Fix LockSet._names() to work with the set-lock · d4803c24
      Guido Trotter authored
      If the set-lock is acquired, currently, the _names function will fail on
      a double acquire of a non-recursive lock. This patch fixes the behavior,
      and some lines of code added to the testAcquireSetLock test check that
      this and other functioins behave properly.
      
      Reviewed-by: imsnah
      d4803c24
  2. Sep 05, 2008
  3. Aug 29, 2008
  4. Aug 18, 2008
    • Guido Trotter's avatar
      A few more locking unit tests · d4f6a91c
      Guido Trotter authored
      A few more tests written while bug-hunting. One of them shows a real
      issue, at last. :)
      
      Reviewed-by: imsnah
      d4f6a91c
    • Guido Trotter's avatar
      Add lock-all-through-GLM unit test · 90c942d1
      Guido Trotter authored
      I was hunting for a bug in my code and thought the culprit was in the
      locking library, so I added a test to check. Unfortunately turns out it
      wasn't. :( Committing the test anyway, while still trying to figure out
      what's wrong...
      
      Reviewed-by: imsnah
      90c942d1
  5. Aug 11, 2008
  6. Jul 31, 2008
  7. Jul 30, 2008
  8. Jul 29, 2008
    • Iustin Pop's avatar
      Add a KillProcess function · b2a1f511
      Iustin Pop authored
      We cannot depend on all environments to have a start-stop-daemon or
      similar tool. We instead implement a KillProcess function that behaves
      similar to “start-stop-daemon --retry”.
      
      Note that the attached unittest can hang in foreground if the child
      misbehaves (doesn't write to the internal pipe). Since unittest are
      either run in the foreground or are run with a timeout from an automated
      framework, I think this is an acceptable trade-off (against of using
      hardcoded timeouts in the test).
      
      Reviewed-by: imsnah
      b2a1f511
    • Iustin Pop's avatar
      Change IsPidFileAlive into ReadPidFile · d9f311d7
      Iustin Pop authored
      We already have a function to test if a PID is alive, so it makes more
      sense to use function composition that force calling (since we need to
      read PIDs from files in other places too). Now IsProcessAlive returns
      False for PIDs <= 0, since this is the error return from ReadPidFile.
      
      The patch also adds a unittest for checking that WriteFile raises the
      correct exception, and checks that an invalid or missing file causes
      ReadPidFile to return zero. The unittest tearDown method will try to
      cleanup the temp directory too (otherwise it leaves stuff after it).
      
      Reviewed-by: ultrotter
      d9f311d7
  9. Jul 28, 2008
  10. Jul 24, 2008
  11. Jul 23, 2008
    • Guido Trotter's avatar
      Invert nodes/instances locking order · 04e1bfaf
      Guido Trotter authored
      An implementation mistake from the original design caused nodes to be
      locked before instances, rather than after. This patch inverts the level
      numbering, changing also the relevant unittests and the recursive
      locking function starting point.
      
      Reviewed-by: iustinp
      04e1bfaf
  12. Jul 22, 2008
  13. Jul 11, 2008
  14. Jul 09, 2008
  15. Jul 08, 2008
    • Guido Trotter's avatar
      Add a more comment lines to testLockingConstants · b10b9d74
      Guido Trotter authored
      This is to discourage even more whoever may think that this requirement
      is not really useful and can be lifted, and to at least know where it's
      used before trying to break it.
      
      Reviewed-by: imsnah
      b10b9d74
    • Guido Trotter's avatar
      Add a new LockSet unittest · 2e1d6d96
      Guido Trotter authored
      This test checks the LockSet behaviour when an empty list is passed.
      The current behaviour is expected, but since this is a corner case,
      we're safer to keep it under a check, and if we need a different one
      monitor that everything is as we expect it to be.
      
      Reviewed-by: imsnah
      2e1d6d96
    • Guido Trotter's avatar
      Pass context to LUs · 77b657a3
      Guido Trotter authored
      Rather than passing a ConfigWriter to the LUs we'll pass the whole
      context, from which a ConfigWriter can be extracted, but we can also
      access the GanetiLockManager. This also fixes the places where a FakeLU
      is created.
      
      Reviewed-by: iustinp
      77b657a3
    • Guido Trotter's avatar
      mocks: create a FakeContext object · f4555db2
      Guido Trotter authored
      This will be passed to FakeLUs
      
      Reviewed-by: iustinp
      f4555db2
    • Guido Trotter's avatar
      Locking: remove LEVEL_CONFIG lockset · 08a6c581
      Guido Trotter authored
      Since the ConfigWriter now handles its own locking it's not necessary to
      have a specific level for the config in the Locking Manager anymore.
      This patch thus removes it, and all the unittest calls that used it, or
      depended on it being present.
      
      Reviewed-by: iustinp
      08a6c581
    • Guido Trotter's avatar
      Locking: add ssynchronized decorator · 42a999d1
      Guido Trotter authored
      This patch creates a new decorator function ssynchronized in the locking
      library, which takes as input a SharedLock, and synchronizes access to
      the decorated functions using it. The usual SharedLock semantics apply,
      so it's possible to call more than one synchronized function at the same
      time, when the lock is acquired in shared mode, and still protect
      against exclusive access.
      
      The patch also adds a few unit test to check the basic decorator's
      functionality, and to provide an example on how to use it.
      
      Reviewed-by: iustinp
      42a999d1
  16. Jul 04, 2008
  17. Jul 01, 2008
  18. Jun 30, 2008
  19. Jun 23, 2008
  20. Jun 19, 2008
  21. Jun 18, 2008
    • Iustin Pop's avatar
      Fix bdev unittest when run under distcheck · ae9da390
      Iustin Pop authored
      The path to the filename for drbd8 proc data is not correctly computed
      when using distcheck. The patch duplicates it from the other drbd tests.
      
      Reviewed-by: ultrotter
      ae9da390
    • Iustin Pop's avatar
      Rework the DRBD8 device status computation · 6b90c22e
      Iustin Pop authored
      Currently, compute the status of a drbd8 device in GetSyncStatus and
      return only the values that we need (and fit in the framework of
      GetSyncStatus). However, the full status details are useful (and needed)
      in other places, so the patch attempts to improve this situation.
      
      We abstract the status of a device outside in a separate class, that
      knows how to parse contents from /proc/drbd and set easily accessible
      attributes. We then simplify the GetSyncStatus to use this and return
      the values that it needs, and add a separate method that returns the
      full status object.
      
      The move to a separate class cleans up a little bit the old
      sync-progress computation from GetSyncStatus, but it's still many
      regexes.
      
      The patch also adds unittests for a few statuses, and modifies one
      BaseDRBD call to accept a custom filename instead of '/proc/drbd' to
      ease unittests.
      
      Reviewed-by: imsnah
      6b90c22e
  22. May 07, 2008
  23. May 01, 2008
  24. Apr 28, 2008
    • Manuel Franceschini's avatar
      Make testSignal unittest not depend on default shell · 01fd6005
      Manuel Franceschini authored
      This patch changes the code executed when testing the signal handling
      of RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,
      where it points to /bin/dash) this test might fail due to the returned
      exit code is different so the received signal is not correctly
      detected.
      
      Additionally fix the docstring of testSignal.
      
      Reviewed-by: iustinp
      01fd6005
  25. Mar 18, 2008
    • Michael Hanselmann's avatar
      Add function to write cluster SSH key to known_hosts file · 75a5f456
      Michael Hanselmann authored
      The whole Ganeti cluster has a single SSH key. Its fingerprint is
      written to Ganeti's known_hosts file, together with an alias. This
      allows us to always use that alias instead of the real hostname,
      making management of the known_hosts file much easier.
      
      This patch does not handle an upgrade from an earlier version.
      
      Reviewed-by: ultrotter
      75a5f456
  26. Mar 11, 2008
    • Iustin Pop's avatar
      Modify utils.TcpPing to make source address optional · b15d625f
      Iustin Pop authored
      This patch modifies TcpPing and its callers to make the source address
      selection optional. Usually, the kernel will know better what
      source address to use, just in some cases we want to enforce a given
      source address so it makes sense to make this optional.
      
      Reviewed-by: ultrotter
      b15d625f
Loading