@@ -225,6 +225,19 @@ def build(self, path, vpp_path):
225225 tag = self .image , rm = True )
226226 return ref
227227
228+ def release (self , path , vpp_path ):
229+ env = Environment (
230+ loader = FileSystemLoader (path ),
231+ trim_blocks = True )
232+
233+ self .tmp_render (join (vpp_path , "Dockerfile" ),
234+ env .get_template ("Dockerfile.j2.release" ),
235+ {'vpp_path' : vpp_path })
236+
237+ ref , _ = self .client .images .build (path = vpp_path ,
238+ tag = self .image , rm = True )
239+ return ref
240+
228241 def new (self , name ):
229242 return Container .new (self .client , self .image , name )
230243
@@ -519,14 +532,14 @@ def test_tmap(self):
519532 local_mac = "aa:bb:cc:dd:ee:11" , remote_mac = "aa:bb:cc:dd:ee:22" )
520533
521534 c1 .vppctl_exec ("set sr encaps source addr A1::1" )
522- c1 .vppctl_exec ("sr policy add bsid D1:: next D2:: next D3:: gtp4_removal sr_prefix D4::/32 local_prefix C1::/64" )
535+ c1 .vppctl_exec ("sr policy add bsid D1:: next D2:: next D3:: gtp4_removal sr_prefix D4::/32 v6src_prefix C1::/64" )
523536 c1 .vppctl_exec ("sr steer l3 172.20.0.1/32 via bsid D1::" )
524537
525538 c2 .vppctl_exec ("sr localsid address D2:: behavior end" )
526539
527540 c3 .vppctl_exec ("sr localsid address D3:: behavior end" )
528541
529- c4 .vppctl_exec ("sr localsid prefix D4::/32 behavior end.m.gtp4.e C1::/ 64" )
542+ c4 .vppctl_exec ("sr localsid prefix D4::/32 behavior end.m.gtp4.e v4src_position 64" )
530543
531544 c2 .set_ipv6_route ("eth2" , "A2::2" , "D3::/128" )
532545 c2 .set_ipv6_route ("eth1" , "A1::1" , "C::/120" )
@@ -580,14 +593,14 @@ def test_tmap_ipv6(self):
580593 local_mac = "aa:bb:cc:dd:ee:11" , remote_mac = "aa:bb:cc:dd:ee:22" )
581594
582595 c1 .vppctl_exec ("set sr encaps source addr A1::1" )
583- c1 .vppctl_exec ("sr policy add bsid D1:: next D2:: next D3:: gtp4_removal sr_prefix D4::/32 local_prefix C1::/64" )
596+ c1 .vppctl_exec ("sr policy add bsid D1:: next D2:: next D3:: gtp4_removal sr_prefix D4::/32 v6src_prefix C1::/64" )
584597 c1 .vppctl_exec ("sr steer l3 172.20.0.1/32 via bsid D1::" )
585598
586599 c2 .vppctl_exec ("sr localsid address D2:: behavior end" )
587600
588601 c3 .vppctl_exec ("sr localsid address D3:: behavior end" )
589602
590- c4 .vppctl_exec ("sr localsid prefix D4::/32 behavior end.m.gtp4.e C1::/ 64" )
603+ c4 .vppctl_exec ("sr localsid prefix D4::/32 behavior end.m.gtp4.e v4src_position 64" )
591604
592605 c2 .set_ipv6_route ("eth2" , "A2::2" , "D3::/128" )
593606 c2 .set_ipv6_route ("eth1" , "A1::1" , "C::/120" )
@@ -914,6 +927,9 @@ def build_image(self):
914927 # TODO: optimize build process for speed and image size
915928 self .containers .build (self .path , self .vpp_path )
916929
930+ def release_image (self ):
931+ self .containers .release (self .path , self .vpp_path )
932+
917933 def vppctl (self , index , command = None ):
918934 if index >= len (self .instance_names ):
919935 return
@@ -943,7 +959,7 @@ def get_args():
943959 help = "Infrastructure related commands." )
944960
945961 p1 .add_argument ("op" , choices = [
946- 'stop' , 'start' , 'status' , 'restart' , 'build' ])
962+ 'stop' , 'start' , 'status' , 'restart' , 'build' , 'release' ])
947963
948964 p1 .add_argument ("--prefix" )
949965 p1 .add_argument ("--image" )
@@ -984,6 +1000,8 @@ def main(op=None, image=None, prefix=None, verbose=None, index=None, command=Non
9841000 try :
9851001 if op == 'build' :
9861002 program .build_image ()
1003+ elif op == 'release' :
1004+ program .release_image ()
9871005 elif op == 'stop' :
9881006 program .stop_containers ()
9891007 elif op == 'start' :
0 commit comments