return len(routes) == 0
            wait_for(f)
 
    def test_03_check_gobgp_adj_rib_out(self):
        for q in self.quaggas.itervalues():
            paths = [p['nlri']['prefix'] for p in self.gobgp.get_adj_rib_out(q)]
            for qq in self.quaggas.itervalues():
                if q == qq:
                    continue
                if self.gobgp.peers[q]['is_rr_client']:
                    for p in qq.routes.keys():
                        self.assertTrue(p in paths)
                else:
                    for p in qq.routes.keys():
                        if self.gobgp.peers[qq]['is_rr_client']:
                            self.assertTrue(p in paths)
                        else:
                            self.assertFalse(p in paths)

if __name__ == '__main__':
    if os.geteuid() is not 0:
        print "you are not root."
        sys.exit(1)
    output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
    if int(output) is not 0:
        print "docker not found"
        sys.exit(1)

    nose.main(argv=sys.argv, addplugins=[OptionParser()],
              defaultTest=sys.argv[0])
Exemple #2
0
        for p in next_prefix():
            g1.local('gobgp global rib add {0}'.format(p))
            cnt += 1

        cnt2 = 0
        g = next_prefix()
        n = g.next()
        for path in g1.local("gobgp global rib", capture=True).split('\n')[1:]:
            if [elem for elem in path.split(' ') if elem != ''][1] == n:
                try:
                    cnt2 += 1
                    n = g.next()
                except StopIteration:
                    break

        self.assertTrue(cnt == cnt2)


if __name__ == '__main__':
    if os.geteuid() is not 0:
        print "you are not root."
        sys.exit(1)
    output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
    if int(output) is not 0:
        print "docker not found"
        sys.exit(1)

    nose.main(argv=sys.argv,
              addplugins=[OptionParser()],
              defaultTest=sys.argv[0])