         expect(table['destinations'].length).to.equal 1
 
         path = table['destinations'][0]
-        expect(path['prefix']).to.equal '10.0.0.0/24'
+        expect(path['prefix']).to.equal PREFIX
 
     it 'withdraws a route', ->
-      exec 'gobgp global rib add 10.0.0.0/24'
+      exec "gobgp global rib add #{PREFIX}"
       expect(global_rib()).not.to.be.empty
 
-      gobgp.modPath family: 'ipv4-unicast', withdraw: true, '10.0.0.0/24'
+      gobgp.modPath family: 'ipv4-unicast', withdraw: true, PREFIX
 
       expect(global_rib()).to.be.empty
+
+
+  describe 'family ipv4-flowspec', ->
+    it 'originates a route', ->
+      expect(flowspec_rib()).to.be.empty
+
+      gobgp.modPath family: 'ipv4-flowspec', FLOWSPEC_PREFIX
+
+      table = flowspec_rib()
+      expect(table.length).to.equal 1
+      expect(table[0].prefix).to.equal "[source:#{PREFIX}]"
+
+    it 'shows the RIB', ->  # TODO: This does actually nothing. Usechai-as-promised
+      exec "gobgp global rib -a ipv4-flowspec add #{FLOWSPEC_PREFIX}"
+
+      gobgp.getRib family: 'ipv4-flowspec', (err, table) ->
+        expect(table.type).to.equal 'GLOBAL'
+        expect(table.family).to.equal 65669
+        expect(table.destinations.length).to.equal 1
+
+        path = table.destinations[0]
+        expect(path.prefix).to.equal "[source:#{PREFIX}]"
+        expect(path.paths[0].attrs[2].value[0].rate).to.equal 10000
+
+    it 'withdraws a route', ->
+      exec "gobgp global rib -a ipv4-flowspec add #{FLOWSPEC_PREFIX}"
+      expect(flowspec_rib()).not.to.be.empty
+
+      gobgp.modPath family: 'ipv4-flowspec', withdraw: true, FLOWSPEC_PREFIX
+
+      expect(flowspec_rib()).to.be.empty

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


  beforeEach ->
    exec 'gobgp global rib del 10.0.0.0/24'


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

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

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

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

      gobgp.modPath family: 'ipv4-unicast', '10.0.0.0/24 community no-advertise'

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

      expect(communities('10.0.0.0/24')).to.eql [4294967042]

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

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


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

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

    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'
