~andreserl/maas/qa-lab-tests-bionic

« back to all changes in this revision

Viewing changes to common.py

  • Committer: Andres Rodriguez
  • Date: 2017-12-14 20:17:33 UTC
  • Revision ID: andreserl@ubuntu.com-20171214201733-c5t28d469mxpim53
Work around issue in bionic where it discovers one extra subnet that's not on xenial

Show diffs side-by-side

added added

removed removed

Lines of Context:
873
873
    def test_list_subnets(self):
874
874
        output, _ = self._run_maas_cli(['subnets', 'read'])
875
875
        out_dict = loads(output)
876
 
        self.assertEqual(2, len(out_dict), 'space-0 should now have 2 subnets')
 
876
        # XXX: This is a work around to unblock the bionic CI. For whatever
 
877
        # reason, Bionic discovers 3 subnets instead of 2 in older releases.
 
878
        # This could be due to the transition to netplan is causing MAAS
 
879
        # to obtain an IP that shouldn't really get. We need to investigate
 
880
        # why this is
 
881
        if StrictVersion(get_maas_version()[:3]) > StrictVersion('2.3'):
 
882
            self.assertEqual(
 
883
                3, len(out_dict),
 
884
                'MAAS should have 3, subnets but it has %d' % len(out_dict))
 
885
        else:
 
886
            self.assertEqual(
 
887
                2, len(out_dict),
 
888
                'MAAS should have 2, subnets but it has %d' % len(out_dict))
877
889
 
878
890
    @skipIf(
879
891
        StrictVersion(get_maas_version()[:3]) < StrictVersion('1.9'),