@@ -230,6 +230,7 @@ func testDockerAppLifecycle(t *testing.T, useBindMount bool) {
230230 fmt .Sprintf ("Creating service %s_api" , appName ),
231231 fmt .Sprintf ("Creating service %s_web" , appName ),
232232 })
233+ assertAppLabels (t , & cmd , appName , "db" )
233234
234235 // List the installed application
235236 cmd .Command = dockerCli .Command ("app" , "ls" )
@@ -254,6 +255,7 @@ func testDockerAppLifecycle(t *testing.T, useBindMount bool) {
254255 fmt .Sprintf ("Updating service %s_api" , appName ),
255256 fmt .Sprintf ("Updating service %s_web" , appName ),
256257 })
258+ assertAppLabels (t , & cmd , appName , "db" )
257259
258260 // Uninstall the application
259261 cmd .Command = dockerCli .Command ("app" , "rm" , appName )
@@ -405,6 +407,15 @@ func initializeDockerAppEnvironment(t *testing.T, cmd *icmd.Cmd, tmpDir *fs.Dir,
405407 icmd .RunCmd (* cmd ).Assert (t , icmd .Success )
406408}
407409
410+ func assertAppLabels (t * testing.T , cmd * icmd.Cmd , appName , containerName string ) {
411+ cmd .Command = dockerCli .Command ("inspect" , fmt .Sprintf ("%s_%s" , appName , containerName ))
412+ checkContains (t , icmd .RunCmd (* cmd ).Assert (t , icmd .Success ).Combined (),
413+ []string {
414+ fmt .Sprintf (`"%s": "%s"` , internal .LabelAppNamespace , appName ),
415+ fmt .Sprintf (`"%s": ".+"` , internal .LabelAppVersion ),
416+ })
417+ }
418+
408419func checkContains (t * testing.T , combined string , expectedLines []string ) {
409420 for _ , expected := range expectedLines {
410421 exp := regexp .MustCompile (expected )
0 commit comments