Skip to content
  • Iustin Pop's avatar
    Fix a few issues in unittest data generation · a2a0bcd8
    Iustin Pop authored
    
    
    This patch fixes two ugly but non-critical issues:
    
    - the getFQDN wrongly generated only the first component as
      limited-length name, the rest could be any length, and that makes
      the generated name bad for display purposes
    - the random generator had real issues in finding an offline instance
      with the right properties when starting from certain seeds (found
      accidentally); this meant the test took 1 minute, instead of ~300ms,
      for the node_addSecOffline
    
    Furthermore, for the same evil seed, the Container_findByName test
    wasn't able to generate enough good data, so we change its
    implementation to directly generate an uniques list, instead of
    generating random lists and filtering the unique ones.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
    a2a0bcd8