Skip to content
Snippets Groups Projects
  1. Jan 20, 2009
    • Iustin Pop's avatar
      DRBD: check for in-use minor during Create · 767d52d3
      Iustin Pop authored
      In order to prevent errors with old, in-use DRBD minors, we check and
      abort at create time if our minor is already in use. For this we need to
      also modify DRBD8Status to be able to parse cs:Unconfigured devices.
      
      Reviewed-by: ultrotter
      767d52d3
    • Iustin Pop's avatar
      Add a TailFile function · f65f63ef
      Iustin Pop authored
      This patch adds a tail file function, to be used for parsing and returning in
      the job log OS installation failures.
      
      Reviewed-by: ultrotter
      f65f63ef
    • Iustin Pop's avatar
      Unify some unittest functions · 51596eb2
      Iustin Pop authored
      This patch adds unified temporary file handling to the
      testutils.GanetiTestCase class, which adds easy creation and automated
      cleanup of temporary files.
      
      The patch allows a simpler handling in a couple of test cases but
      requires all child classes to call the parent setUp and tearDown
      methods.
      
      Reviewed-by: ultrotter
      51596eb2
  2. Dec 19, 2008
  3. Dec 18, 2008
  4. Dec 17, 2008
  5. Dec 04, 2008
  6. Dec 03, 2008
  7. Dec 02, 2008
  8. Nov 28, 2008
  9. Nov 23, 2008
    • Iustin Pop's avatar
      Enable auto-unit formatting in script output · 9fbfbb7b
      Iustin Pop authored
      This patch enables by default the old 'human-readable' option, but in a
      slightly different model.
      
      The option is now called "units" and takes either:
       - 'h' for automatic formatting
       - 'm', 'g' or 't' for mebi/gibi/tebibytes
      
      If 'h' is used, we add a unit suffix, otherwise nothing is added so that
      parsing is easy.
      
      The default value of this unit is:
        - 'h' if a separator is not passed
        - 'm' if a separator is passed
      
      Reviewed-by: ultrotter
      9fbfbb7b
  10. Nov 21, 2008
    • Iustin Pop's avatar
      Move FieldSet class to utils.py · a2d2e1a7
      Iustin Pop authored
      Since we can use the FieldSet class in cli.py to nicely format disk
      sizes and such, we move it to utils.py and also move its associated
      unittest. I didn't remove the cmdlib.py unittest file as that's not the
      good direction :)
      
      Reviewed-by: ultrotter
      a2d2e1a7
  11. Nov 18, 2008
    • Iustin Pop's avatar
      Skip another testWaitingXblocksY · a143be68
      Iustin Pop authored
      The waiting sharer blocks exclusive is another not-possible to test
      right now.
      
      Sorry for missing it the first time; there are no other testWaiting...
      tests.
      
      Reviewed-by: ultrotter
      a143be68
    • Iustin Pop's avatar
      Add a FieldSet class for variable parameter sets · 6de7c41d
      Iustin Pop authored
      This patch adds a _FieldSet class that can be used for the new variable
      parameter sets: e.g. the sda_size will change to disk/0.size (or
      similar) and we need to both check validity and extract the index of the
      parameter easily.
      
      The patch also sorts the unittest list in Makefile.am.
      
      Reviewed-by: ultrotter
      6de7c41d
    • Iustin Pop's avatar
      Skip the waitingExclusiveBlockSharer test · e6416152
      Iustin Pop authored
      Until we have a way to properly test this, we'll skip the test.
      
      Reviewed-by: imsnah
      e6416152
  12. Nov 12, 2008
    • Iustin Pop's avatar
      Convert the locking unittests to repetition-test · 4607c978
      Iustin Pop authored
      Currently the locking tests are using timeouts to ensure an event will
      'never happen'. However, this is suboptimal.
      
      The patch converts all of these to instead: not wait, but sequence the
      operations logically and expect that they execute as such. In case of
      not so, they will timeout with a big (60s) timeout.
      
      The 'never happen' is tested by multiple repetitions of the same test -
      this is not perfect, but again 'X will never happen' is not actually
      testable.
      
      This patch reduces the runtime of the tests from ~5.4 to ~0.8 seconds
      (with 8 repetitions of each test thas has 'never happen' situations).
      
      Reviewed-by: imsnah
      4607c978
  13. Nov 11, 2008
    • Iustin Pop's avatar
      Remove zombie special case from IsProcessAlive · 44bf25ff
      Iustin Pop authored
      Based on the discussion on the mailing list, we remove the special
      casing of zombie processes.
      
      Note we don't use kill -0 since that has a different meaning than "check
      process is alive", so this function is still linux-specific.
      
      Reviewed-by: imsnah
      44bf25ff
    • Iustin Pop's avatar
      Add cleanup of processes to utils.KillProcess · ff5251bc
      Iustin Pop authored
      In case the process we want to signal is our own process, and the signal
      we send is a deadly one, we should also cleanup after the process.
      
      This patch adds a new parameter waitpid to this function that does this,
      and changes its unittest to pass this new parameter.
      
      Reviewed-by: imsnah
      ff5251bc
    • Iustin Pop's avatar
      Implement working directory for utils.RunCmd · 8797df43
      Iustin Pop authored
      In order to replace usage of the shell just for 'cd %s; ...' we need to
      be able to specify the working directory for childs.
      
      The patch also changes the default working directory (when not
      specified) to "/", as opposed to the current dir; since the daemos run
      with cwd=/ anyway, this should not change things.
      
      Reviewed-by: imsnah
      8797df43
  14. Oct 24, 2008
    • Iustin Pop's avatar
      Modify utils.RunCmd to write output to file · 36117c2b
      Iustin Pop authored
      Currently we launch processes via the shell in a few places only to
      redirect standard output and error to a log file ("&> $file"). It is
      better to do such redirection from within RunCmd itself.
      
      This patch splits RunCmd in two parts, the setup and the execution part,
      the latter being implemented in two different functions depending on
      whether we write to a file or not.
      
      We also update the unittests with this new case.
      
      Reviewed-by: imsnah
      36117c2b
  15. Oct 21, 2008
    • Iustin Pop's avatar
      Move some LU logging to use proc.Log* · 86d9d3bb
      Iustin Pop authored
      We change some messages which are obviously intended for the user to use
      the proc.Log* functions instead of (only) the logging ones.
      
      We also fix some wrong uses of feedback_fn.
      
      Reviewed-by: imsnah
      86d9d3bb
  16. Oct 20, 2008
    • Iustin Pop's avatar
      Generalize the reading of test file data · 149a5439
      Iustin Pop authored
      Currently we have two methods in ganeti.bdev_unittest.py of computing
      the test data file name - and, of course, they don't give the same
      results.
      
      The patch moves the functions to compute the test file name and reading
      of its contents to the GanetiTestCase class in testutils, which allows
      running the tests from the command line as well.
      
      We also change assertFileContent to use utils.ReadFile.
      
      Reviewed-by: imsnah
      149a5439
    • Alexander Schreiber's avatar
      Set default hypervisor at cluster init · 02691904
      Alexander Schreiber authored
      During cluster init, set the default hypervisor to be used for instances.
      Ensure that the default hypervisor belongs to the set enabled hypervisors
      for this cluster. Also fix a small bug with setting the default enabled
      hypervisor list.
      
      Reviewed-by: imsnah
      
      02691904
    • Iustin Pop's avatar
      Convert cli.py to logging · 46fbdd04
      Iustin Pop authored
      We also add two function for printing messages, so that scripts won't
      have to import logger to get these. They are a simple extension over the
      logger ones, as they accept the call style from logging:
       ToStdout("Message: %s", msg)
      (instead of requiring formatting by the client.
      
      Reviewed-by: imsnah
      46fbdd04
    • Michael Hanselmann's avatar
      Remove old HTTP server code · fa10bdc5
      Michael Hanselmann authored
      All users of this code have been migrated to the new and shiny HttpServer
      class.
      
      It also fixes a typo in the ApacheLogfile unittests. It has not yet been
      decided whether we should keep ApacheLogfile or not, hence leaving it in.
      
      Reviewed-by: ultrotter
      fa10bdc5
  17. Oct 17, 2008
  18. Oct 16, 2008
    • Iustin Pop's avatar
      Really fix with the zombie test (hopefully) · 09352fa4
      Iustin Pop authored
      So, instead of any timeouts for synchronization, we move to actual
      events. We still have one (huge) timeout for pathological cases (just to
      cleanup), but we don't sleep at all in normal usage.
      
      The patch moves the zombie/cleaned up child creation out from setUp(),
      and to on-demand by the functions. We remove all signal handler usage,
      instead we rely on the fact that when a process is cleaned up, its FDs
      are closed, so the read end of a pipe will get an event.
      
      Reviewed-by: imsnah
      09352fa4
  19. Oct 14, 2008
    • Iustin Pop's avatar
      Implement parameter removal in SplitKeyVal · fcd62d84
      Iustin Pop authored
      This patch adds paramter removal in SplitKeyVal, by prefixing a
      value-less key with "-"; this is needed in resetting parameters back to
      cluster defaults, but care must be applied now that None can come from
      the parser.
      
      Reviewed-by: imsnah
      fcd62d84
  20. Oct 13, 2008
    • Iustin Pop's avatar
      Add two new options types for CLI usage · a8469393
      Iustin Pop authored
      For the new 2.0-style command line options, we need to parse strings of
      the type:
        ident:key=val[,...]
      and
        key=val[,...]
      
      This patch adds two new option builders for these two, which return
      (ident, {key=val,}) and {key=val,} for the above two formats. It also
      handles specially constructs of type “key” (val is set to True) and
      “no_key” (val is set to False, and the ‘no_’ prefix is stripped).
      
      Reviewed-by: imsnah
      a8469393
  21. Oct 12, 2008
    • Iustin Pop's avatar
      Abstract checking own address into a function · caad16e2
      Iustin Pop authored
      Currently, we check if we have a given ip address (i.e. it's alive on
      one of our interfaces) but manually calling TcpPing(source=localhost).
      This works, but having it spread all over the code makes it hard to
      change the implementation.
      
      The patch abstracts this into a separate utils.OwnIpAddress(addr)
      function. We add a rpc call for it, which we use instead of the
      (single-use of) call_node_tcp_ping. We leave node_tcp_ping in, as seems
      useful and eventually it should be removed in a separate patch.
      
      Reviewed-by: imsnah
      caad16e2
  22. Oct 10, 2008
    • Iustin Pop's avatar
      Convert rpc module to RpcRunner · 72737a7f
      Iustin Pop authored
      This big patch changes the call model used in internode-rpc from
      standalong function calls in the rpc module to via a RpcRunner class,
      that holds all the methods. This can be used in the future to enable
      smarter processing in the RPC layer itself (some quick examples are not
      setting the DiskID from cmdlib code, but only once in each rpc call,
      etc.).
      
      There are a few RPC calls that are made outside of the LU code, and
      these calls are left as staticmethods, so they can be used without a
      class instance (which requires a ConfigWriter instance).
      
      Reviewed-by: imsnah
      72737a7f
  23. Oct 08, 2008
  24. Oct 06, 2008
    • Iustin Pop's avatar
      Add a simple timespec parsing function · 2241e2b9
      Iustin Pop authored
      This function will be used for auto-archiving jobs via the command line.
      The function is pretty simple, we only support up to weeks since months
      and higher are not 'precise' entities, and dealing with them would
      require us to start using calendar functions.
      
      Reviewed-by: imsnah
      2241e2b9
  25. Oct 01, 2008
  26. 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
Loading