1. 12 Oct, 2012 3 commits
  2. 11 Oct, 2012 1 commit
  3. 10 Oct, 2012 2 commits
  4. 08 Oct, 2012 5 commits
    • Iustin Pop's avatar
      Merge ganeti-master-cleaner back into ganeti-cleaner · 46118ed2
      Iustin Pop authored
      As I wrote during/after the review on commit 2958c56e, “ganeti-cleaner:
      Separate queue cleaning code”, while I appreciated the permission
      separation, I didn't like too much the file-based approach:
      
      - it is a very simple script, and lots of the code is duplicated
        between the two; I wouldn't like to see "ganeti-vmcapable-cleaner",
        "ganeti-master-candidate-cleaner", etc. in the future
      - ganeti-master-cleaner "pollutes" the namespace, creating
        tab-completion conflicts with ganeti-masterd
      
      This patch simply merges the master-cleaner back into cleaner, while
      keeping the separate user permissions scheme, separate log files, etc.
      
      Additionally, it fixes two bugs in the unit-test (not run with set -u
      and wrong path in the master-cleaner log files test; yay for even
      worse safety than Python?).
      
      And finally, since we have now support for --help-completion, it adds
      bash completion support for this script :) (needs to be applied on top
      of my argument suppo...
      46118ed2
    • Iustin Pop's avatar
      Enable bash completion for Haskell daemons too · f8d01158
      Iustin Pop authored
      
      
      This requires a few tiny changes to build-bash-completion and to
      Makefile rules, but is straightforward.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      f8d01158
    • Iustin Pop's avatar
      A few cleanups in Makefile.am · dad26941
      Iustin Pop authored
      
      
      A lot of the lists in Makefile.am were not sorted properly (or at
      all); let's sort them for more sanity.
      
      Additionally, check-local used to spew this big shell block, even
      though it does emit nice messages when failing, so we don't need to
      show the code; let's silence it (@).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      dad26941
    • Iustin Pop's avatar
      Fixup TAGS generation with newer GHC · 6b84f036
      Iustin Pop authored
      
      
      Newer GHC refuses to allow "-O" with interactive mode, so let's filter
      that out. Furthermore, sometimes you don't have a clean tree exactly
      when you need to look up something/update the tags, so let's filter
      out the "-Werror" too.
      
      And finally, we need to pass the actual exact flags (including
      nocurl, parallel, etc.) that we use for building, so let's add those
      too.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      6b84f036
    • Iustin Pop's avatar
      Rename Ganeti/HTools/Utils.hs to Ganeti/Utils.hs · 26d62e4c
      Iustin Pop authored
      
      
      This is, I believe, the last non-htools specific file that still lived
      in the htools directory; it's already widely used in non-htools code,
      so let's move it before we add more functionality to this module.
      
      All changes are related to the name change, imports fixup, etc.; there
      are no other changes in this patch.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      26d62e4c
  5. 05 Oct, 2012 1 commit
  6. 02 Oct, 2012 4 commits
  7. 28 Sep, 2012 2 commits
  8. 27 Sep, 2012 3 commits
  9. 26 Sep, 2012 2 commits
  10. 25 Sep, 2012 1 commit
  11. 24 Sep, 2012 1 commit
  12. 21 Sep, 2012 1 commit
  13. 19 Sep, 2012 1 commit
  14. 18 Sep, 2012 2 commits
  15. 12 Sep, 2012 2 commits
  16. 05 Sep, 2012 6 commits
    • Iustin Pop's avatar
      Rework CLI modules and tests · 51000365
      Iustin Pop authored
      While investigating how we could test the Daemon.hs module, I realised
      that we have a very, erm, sub-optimal situation:
      
      - HTools/CLI.hs has a nice IO/pure separation testing in cmdline
        parsing, which allows some basic functionality to be tested, but
        uses direct 'read' in many options, which fails at runtime when
        evaluating the argument, and not when parsing the options
      - Daemon.hs lacks that, but has a much nicer 'reqWithConversion'
        helper that can be used for nicer option parsing, and uses that +
        tryRead instead of plain 'read'
      
      Since this situation is very bad, let's clean it up. We introduce yet
      another module, Common.hs, that holds functionality common to all
      command line programs (daemons or not). We move the parsing to this
      module, and introduce a type class to handle option types which
      support --help/--version. This allows removal of duplicated code from
      CLI.hs and Daemon.hs.
      
      The other part of the patch is cleanup/rework of the tests for this
      code: we introduce some helpers (checkOpt, passFailOpt,
      checkEarlyExit) that can be used from the much-slimmer now tests for
      CLI and Daemon. In the common module, we just test the yes/no helper
      we have. Many new tests for boolean options and numeric options are
      added.
      
      A side change is the removal of the obsolete `--replay-count',
      `--test-size' options (unused since commit 95f6c931
      
      , “Switch Haskell
      test harness to test-framework”).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      51000365
    • Iustin Pop's avatar
      Add query filter tests · 90171729
      Iustin Pop authored
      
      
      These tests are node specific only because we don't have other query
      types implemented yet, but what they actually test is the various
      filter types.
      
      The tests are trying to cover most filter functionality; missing for
      now is proper checking for ContainsFilter and TrueFilter, the rest
      should be more or less covered.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      90171729
    • Iustin Pop's avatar
      Add some unittests for node queries · b9bdc10e
      Iustin Pop authored
      
      
      These new tests check that:
      
      - no known fields return unknown
      - any unknown field returns unknown
      - the type of the fields is consistent between the getters and the
        field definition
      - the length of each result row corresponds with the number of fields
        queried, and the length of the field definitions returned
      - the length of the rows corresponds to the number of nodes
      - querying fields on empty fields returns all fields
      
      Finally this patch found a bug, in that the pinst_list/sinst_list
      fields were declared as QFTNumber (copy-paste error from
      pinst_cnt/sinst_cnt), yay!
      
      I also changed genEmptyCluster to ensure that it generates unique node
      names, so that the number of result rows is consistent with what we
      requested, and switched ResultEntry from a normal constructor to
      record syntax, so that we can extract the fields without having to use
      pattern matching.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      b9bdc10e
    • Iustin Pop's avatar
      Add unittests for the BasicTypes module · 1493a93b
      Iustin Pop authored
      
      
      This adds test properties for the various laws that the instances of
      Result should follow; I could not find (offline) laws about `mappend',
      but otherwise I implemented all laws that I could find.
      
      Note that we have to silence hlint warnings for the things we want to
      test, as otherwise hlint is all "this is already true based on the
      functor law, why 'fmap id' and not just 'id'?".
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      1493a93b
    • Iustin Pop's avatar
      Move Version.hs up from under HTools/ · 2997cb0a
      Iustin Pop authored
      
      
      This is another module that is generic, and not htools-specific.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      2997cb0a
    • Iustin Pop's avatar
      Two tiny makefile fixes · 662de722
      Iustin Pop authored
      
      
      During the recent moves and renames, two things have slipped through,
      since I didn't run make check-local…
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      662de722
  17. 04 Sep, 2012 3 commits