1. 20 Nov, 2012 4 commits
    • Michele Tartara's avatar
      Add DRBD parser unit tests · a52f8e72
      Michele Tartara authored
      
      
      This adds tests that existing test files can be parsed by the Haskell
      parser as well, plus one new test file.
      Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      a52f8e72
    • Michele Tartara's avatar
      Add parser for DRBD /proc file · 3c1915df
      Michele Tartara authored
      
      
      A new directory for haskell modules about block devices has been created
      The parser is divided in two modules:
      * one exports the data types describing the DRBD status
      * one exports the parser itself
      Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
      [iustin@google.com: indentation/alignment fixes]
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      3c1915df
    • Iustin Pop's avatar
      Split OpCode.hs and add module for opcode parameters · 92f51573
      Iustin Pop authored
      
      
      Due to TemplateHaskell stage restrictions, we can't define parameters
      in the same module as we're using them for TH, so we have to define
      all module parameters in a separate module.
      
      This patch therefore splits OpCodes.hs in two, adding that module and
      moves most code there (types, parameters, etc.). The remaining parts
      in OpCodes.hs, the actual opcode definitions, now use more parameters
      instead of direct field definitions (more will come later)
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
      92f51573
    • Iustin Pop's avatar
      Create a new Ganeti/Types.hs module · 5e9deac0
      Iustin Pop authored
      There are already three cases where we copied type definitions between
      the htools-specific types into the main ganeti code. Let's stop doing
      this 
      
       and create a common types module that holds these.
      
      Note that there already exists BasicTypes.hs, but that refers to very
      low-level types, and can't use TH derivation itself.
      
      A side effect of this unification is that there is a small conflict
      between AdminStatus/AdminOffline and InstanceStatus/AdminOffline. As
      such, I renamed AdminOffline and AdminDown to StatusOffline/StatusDown
      in the InstanceStatus type.
      
      The patch also moves the tests related to these types to a new test
      module.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
      5e9deac0
  2. 19 Nov, 2012 2 commits
  3. 16 Nov, 2012 3 commits
  4. 15 Nov, 2012 2 commits
  5. 13 Nov, 2012 4 commits
    • Michael Hanselmann's avatar
      Add new test for RAPI · 105f0d47
      Michael Hanselmann authored
      
      
      Unlike existing tests, this actually tests RAPI at the interface with
      the HTTP server. This way authentification can also be tested. A test
      for “/2/query/…” is included as it's a bit special.
      Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
      105f0d47
    • Iustin Pop's avatar
      Automatically enable version-dependent GHC flags · 39f0eea5
      Iustin Pop authored
      
      
      Some GHC flags are very useful, but only appear in more recent GHC
      versions. To support the use of such flags while still supporting
      older compilers, let's add conditional checks and enabling based on
      the results.
      
      Currently only `-fwarn-incomplete-uni-patterns` is enabled, which
      detects refutable patterns in lambda expressions and pattern bindings
      (e.g. "let (Just x) = y"); such constructs are bad as they can lead to
      runtime exceptions.
      
      Additionally, fix an existing such bad construct in a test case; we
      workaround it by using error, since that should never fail.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      39f0eea5
    • Michele Tartara's avatar
      Added attoparsec unit test for Unicode parsing · 43b3b5c1
      Michele Tartara authored
      
      
      Attoparsec is known to have had issues with parsing non-ASCII strings.
      This test makes sure that parsing of Unicode characters works fine.
      Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
      [iustin: small doc string fixes]
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      43b3b5c1
    • Iustin Pop's avatar
      Improve make regen-vcs-version · 6376dcc0
      Iustin Pop authored
      
      
      "make regen-vcs-version" is run at every ./devel/upload time, in order
      to have reasonably up-to-date information in the uploaded
      scripts/binaries. However, this means it currently triggers
      recompilation of (at least) Ganeti/Version.hs, and sometimes more than
      that.
      
      Since we only care about the contents of the file and not the
      timestamp, let's change the make rule so that it only updates the file
      if there are actually changes in the content, as checked by
      "cmp". This results in a much faster ./devel/upload, especially for
      small changes in the (non-Haskell) code, or when the code has already
      been compiled.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      6376dcc0
  6. 08 Nov, 2012 1 commit
  7. 07 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Switch devel/upload to a static file · f9435bdc
      Iustin Pop authored
      
      
      We had twice in the past days questions about devel/upload being
      "broken", since bash re-reads shell scripts during their run and this
      file can get regenerated due to Makefile changes.
      
      Since we only need this to be dynamically built for 3 variables, let's
      make the file static and read those three variables when it is run,
      instead of when it is built, which allows us to re-read the "latest
      version" of these vars as well.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      f9435bdc
  8. 06 Nov, 2012 1 commit
  9. 26 Oct, 2012 3 commits
  10. 25 Oct, 2012 3 commits
  11. 24 Oct, 2012 2 commits
  12. 23 Oct, 2012 1 commit
  13. 22 Oct, 2012 2 commits
  14. 18 Oct, 2012 1 commit
  15. 17 Oct, 2012 2 commits
  16. 16 Oct, 2012 5 commits
  17. 12 Oct, 2012 3 commits