 
       table = global_rib()
       expect(table.length).to.equal 1
-      expect(table[0]['prefix']).to.equal '10.0.0.0/24'
+      expect(table[0]['prefix']).to.equal PREFIX
 
-      expect(communities('10.0.0.0/24')).to.eql [4294967042]
+      expect(communities(PREFIX)).to.eql [4294967042]
 
-    it 'shows the RIB', ->
-      exec 'gobgp global rib add 10.0.0.0/24'
+    it 'shows the RIB', ->  # TODO: This does actually nothing. Usechai-as-promised
+      exec "gobgp global rib add #{PREFIX}"
 
       gobgp.getRib family: 'ipv4-unicast', (err, table) ->
         expect(table['type']).to.equal 'GLOBAL'

        expect(table['destinations'].length).to.equal 1

        path = table['destinations'][0]
        expect(path['prefix']).to.equal '10.0.0.0/24'

    it 'withdraws a route', ->
      exec 'gobgp global rib add 10.0.0.0/24'
      expect(global_rib()).not.to.be.empty

      gobgp.modPath family: 'ipv4-unicast', withdraw: true, '10.0.0.0/24'

      expect(global_rib()).to.be.empty

    comms = paths[0]['paths'][0]['attrs'].filter (i) -> i['type']==8
    return comms[0]['communities']

  PREFIX = '10.0.0.0/24'
  FLOWSPEC_PREFIX = "match source #{PREFIX} then rate-limit 10000"

  beforeEach ->
    exec "gobgp global rib del #{PREFIX}"
    exec "gobgp global rib -a ipv4-flowspec del #{FLOWSPEC_PREFIX}"


  describe 'family ipv4-unicast', ->
    it 'originates a route', ->
      expect(global_rib()).to.be.empty

      gobgp.modPath family: 'ipv4-unicast', PREFIX

      table = global_rib()
      expect(table.length).to.equal 1
      expect(table[0]['prefix']).to.equal PREFIX

    it 'originates a route with BGP community string', ->
      expect(global_rib()).to.be.empty

      gobgp.modPath family: 'ipv4-unicast', "#{PREFIX} community no-advertise"

      table = global_rib()
      expect(table.length).to.equal 1
      expect(table[0]['prefix']).to.equal PREFIX

      expect(communities(PREFIX)).to.eql [4294967042]

    it 'originates a route with BGP community byte array', ->
      expect(global_rib()).to.be.empty

      path = gobgp.serializePath('ipv4-unicast', PREFIX)
      path.pattrs.push new Buffer([
        0xc0,                      # Optional, Transitive
        0x08,                      # Type Code: Communities
