Skip to content

Instantly share code, notes, and snippets.

@michaljemala
Last active August 29, 2015 14:09
Show Gist options
  • Save michaljemala/35468a138ba73d0e3918 to your computer and use it in GitHub Desktop.
Save michaljemala/35468a138ba73d0e3918 to your computer and use it in GitHub Desktop.
A transcript of test scenario for PCF security groups
[1]----------------------------------------------------------------------------
$ cf security-groups
Getting security groups as admin
OK
Name Organization Space
#0 all_open
[2]----------------------------------------------------------------------------
$ cf running-security-groups
Acquiring running security groups as 'admin'
OK
all_open
[3]----------------------------------------------------------------------------
$ cf staging-security-groups
Acquiring staging security group as admin
OK
all_open
[4]----------------------------------------------------------------------------
$ cf start ldap-sample
Starting app ldap-sample in org mjemala-org / space dev as admin...
OK
1 of 1 instances running
App started
Showing health and status for app ldap-sample in org mjemala-org / space dev as admin...
OK
requested state: started
instances: ?/1
usage: 8M x 1 instances
urls: ldap-sample.10.10.30.100.xip.io
state since cpu memory disk
#0 running 2014-11-17 02:10:05 PM 0.0% 3.7M of 8M 6.3M of 1G
[5]----------------------------------------------------------------------------
$ curl -I ldap-sample.10.10.30.100.xip.io
HTTP/1.1 200 OK
Connection: close
Content-Length: 16
Content-Type: text/html; charset=utf-8
Date: Mon, 17 Nov 2014 14:10:22 GMT
X-Cf-Requestid: 3cf29018-25c8-429b-4a85-85ba394c97e2
[6]----------------------------------------------------------------------------
$ cf unbind-running-security-group all_open
Unbinding security group all_open from defaults for running as admin
OK
TIP: Changes will not apply to existing running applications until they are restarted.
[7]----------------------------------------------------------------------------
$ cf restart ldap-sample
Stopping app ldap-sample in org mjemala-org / space dev as admin...
OK
Starting app ldap-sample in org mjemala-org / space dev as admin...
OK
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
FAILED
Start app timeout
TIP: use 'cf logs ldap-sample --recent' for more information
[8]----------------------------------------------------------------------------
$ cf logs ldap-sample --recent
014-11-17T14:06:07.11+0000 [DEA] OUT Starting app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:06:07.12+0000 [API] OUT Updated app with guid 308e050f-8e95-48c1-82df-d2c625cfba4a ({"state"=>"STARTED"})
2014-11-17T14:06:08.62+0000 [App/0] OUT [11/17/14 14:06:08] [DEBG] Listening at port 61029
2014-11-17T14:07:05.84+0000 [App/0] OUT Dropped a message because of read error: read unix /var/vcap/data/warden/depot/187q0csavgq/jobs/159/stdout.sock: use of closed network connection
2014-11-17T14:07:05.84+0000 [App/0] ERR
2014-11-17T14:07:05.84+0000 [App/0] ERR Dropped a message because of read error: read unix /var/vcap/data/warden/depot/187q0csavgq/jobs/159/stderr.sock: use of closed network connection
2014-11-17T14:07:05.85+0000 [API] OUT Updated app with guid 308e050f-8e95-48c1-82df-d2c625cfba4a ({"state"=>"STOPPED"})
2014-11-17T14:07:07.01+0000 [DEA] OUT Stopping app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:07:07.01+0000 [DEA] OUT Stopped app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:03.89+0000 [DEA] OUT Starting app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:03.90+0000 [API] OUT Updated app with guid 308e050f-8e95-48c1-82df-d2c625cfba4a ({"state"=>"STARTED"})
2014-11-17T14:10:05.88+0000 [App/0] OUT [11/17/14 14:10:05] [DEBG] Listening at port 61030
2014-11-17T14:10:22.05+0000 [RTR] OUT ldap-sample.10.10.30.100.xip.io - [17/11/2014:14:10:22 +0000] "HEAD / HTTP/1.1" 200 0 "-" "curl/7.37.1" 10.10.30.100:54509 x_forwarded_for:"10.10.10.7, 10.10.30.100" vcap_request_id:cb8cbd0b-45f4-4c6f-7cec-5bb9760495d5 response_time:0.009007625 app_id:308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:43.20+0000 [App/0] OUT Dropped a message because of read error: read unix /var/vcap/data/warden/depot/187q0csavgr/jobs/162/stdout.sock: use of closed network connection
2014-11-17T14:10:43.20+0000 [App/0] ERR
2014-11-17T14:10:43.20+0000 [App/0] ERR Dropped a message because of read error: read unix /var/vcap/data/warden/depot/187q0csavgr/jobs/162/stderr.sock: use of closed network connection
2014-11-17T14:10:43.21+0000 [API] OUT Updated app with guid 308e050f-8e95-48c1-82df-d2c625cfba4a ({"state"=>"STOPPED"})
2014-11-17T14:10:44.00+0000 [DEA] OUT Starting app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:44.00+0000 [API] OUT Updated app with guid 308e050f-8e95-48c1-82df-d2c625cfba4a ({"state"=>"STARTED"})
2014-11-17T14:10:44.37+0000 [DEA] OUT Stopping app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:44.37+0000 [DEA] OUT Stopped app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:46.52+0000 [App/0] ERR panic: LDAP Result Code 200 "": dial tcp 10.10.30.8:389: connection refused
2014-11-17T14:10:46.52+0000 [App/0] ERR goroutine 16 [running]:
2014-11-17T14:10:46.52+0000 [App/0] ERR runtime.panic(0x688740, 0xc20803c0e0)
2014-11-17T14:10:46.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
2014-11-17T14:10:46.52+0000 [App/0] ERR main.main()
2014-11-17T14:10:46.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/ldap-sample/main.go:20 +0x213
2014-11-17T14:10:46.52+0000 [App/0] ERR goroutine 19 [finalizer wait]:
2014-11-17T14:10:46.52+0000 [App/0] ERR runtime.park(0x413710, 0x882018, 0x880289)
2014-11-17T14:10:46.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
2014-11-17T14:10:46.52+0000 [App/0] ERR runtime.parkunlock(0x882018, 0x880289)
2014-11-17T14:10:46.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
2014-11-17T14:10:46.52+0000 [App/0] ERR runfinq()
2014-11-17T14:10:46.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
2014-11-17T14:10:46.52+0000 [App/0] ERR runtime.goexit()
2014-11-17T14:10:46.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1445
2014-11-17T14:10:46.52+0000 [App/0] ERR goroutine 20 [chan receive]:
2014-11-17T14:10:46.52+0000 [App/0] ERR code.google.com/p/log4go.ConsoleLogWriter.run(0xc208028000, 0x7f8da93c8498, 0xc20802e008)
2014-11-17T14:10:46.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:27 +0x79
2014-11-17T14:10:46.52+0000 [App/0] ERR created by code.google.com/p/log4go.NewConsoleLogWriter
2014-11-17T14:10:46.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:19 +0x68
2014-11-17T14:10:46.52+0000 [App/0] ERR goroutine 21 [runnable]:
2014-11-17T14:10:46.52+0000 [App/0] ERR code.google.com/p/log4go.ConsoleLogWriter.run(0xc208028160, 0x7f8da93c8498, 0xc20802e008)
2014-11-17T14:10:46.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:27 +0x79
2014-11-17T14:10:46.52+0000 [App/0] ERR created by code.google.com/p/log4go.NewConsoleLogWriter
2014-11-17T14:10:46.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:19 +0x68
2014-11-17T14:10:46.53+0000 [App/0] OUT
2014-11-17T14:10:46.56+0000 [DEA] ERR Instance (index 0) failed to start accepting connections
2014-11-17T14:10:46.58+0000 [API] OUT App instance exited with guid 308e050f-8e95-48c1-82df-d2c625cfba4a payload: {"cc_partition"=>"default", "droplet"=>"308e050f-8e95-48c1-82df-d2c625cfba4a", "version"=>"4da69b50-45e4-4c4a-857c-dc71746a9f94", "instance"=>"225135e11930468399da9d33bf149f47", "index"=>0, "reason"=>"CRASHED", "exit_status"=>2, "exit_description"=>"app instance exited", "crash_timestamp"=>1416233446}
2014-11-17T14:10:47.64+0000 [DEA] OUT Removing crash for app with id 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:47.65+0000 [DEA] OUT Stopping app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
2014-11-17T14:10:47.65+0000 [DEA] OUT Stopped app instance (index 0) with guid 308e050f-8e95-48c1-82df-d2c625cfba4a
[9]----------------------------------------------------------------------------
$ cat ~/ldap-sec-grp.json
[
{
"destination": "10.10.30.8",
"ports": "389",
"protocol": "tcp"
}
]
[10]----------------------------------------------------------------------------
$ cf create-security-group ldap ~/ldap-sec-grp.json ⏎
Creating security group ldap as admin
OK
[11]----------------------------------------------------------------------------
$ cf security-groups
Getting security groups as admin
OK
Name Organization Space
#0 all_open
#1 ldap
[12]----------------------------------------------------------------------------
$ cf bind-security-group ldap mjemala-org dev
Assigning security group ldap to space mjemala-org in org dev as admin...
OK
TIP: Changes will not apply to existing running applications until they are restarted.
[13]----------------------------------------------------------------------------
$ cf restart ldap-sample
Stopping app ldap-sample in org mjemala-org / space dev as admin...
OK
Starting app ldap-sample in org mjemala-org / space dev as admin...
OK
1 of 1 instances running
App started
Showing health and status for app ldap-sample in org mjemala-org / space dev as admin...
OK
requested state: started
instances: ?/1
usage: 8M x 1 instances
urls: ldap-sample.10.10.30.100.xip.io
state since cpu memory disk
#0 running 2014-11-17 02:18:26 PM 0.0% 3.8M of 8M 6.3M of 1G
[14]----------------------------------------------------------------------------
$ curl -I ldap-sample.10.10.30.100.xip.io
HTTP/1.1 200 OK
Connection: close
Content-Length: 16
Content-Type: text/html; charset=utf-8
Date: Mon, 17 Nov 2014 14:18:41 GMT
X-Cf-Requestid: 46dda5b9-b2bd-4a6b-47b9-7d646c8457ba
[15]----------------------------------------------------------------------------
$ cf target -s staging
API endpoint: https://api.10.10.30.100.xip.io (API version: 2.13.0)
User: admin
Org: mjemala-org
Space: staging
[16]----------------------------------------------------------------------------
$ cf start ldap-sample
Starting app ldap-sample in org mjemala-org / space staging as admin...
OK
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
FAILED
Start app timeout
TIP: use 'cf logs ldap-sample --recent' for more information
[17]----------------------------------------------------------------------------
$ cf logs ldap-sample --recent
2014-11-17T14:37:24.13+0000 [DEA] OUT Starting app instance (index 0) with guid debf4f84-4499-46a8-942e-c241fa7f3eb7
2014-11-17T14:37:26.51+0000 [App/0] ERR panic: LDAP Result Code 200 "": dial tcp 10.10.30.8:389: connection refused
2014-11-17T14:37:26.51+0000 [App/0] ERR goroutine 16 [running]:
2014-11-17T14:37:26.52+0000 [App/0] ERR runtime.panic(0x688740, 0xc20803c0e0)
2014-11-17T14:37:26.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
2014-11-17T14:37:26.52+0000 [App/0] ERR main.main()
2014-11-17T14:37:26.52+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/ldap-sample/main.go:20 +0x213
2014-11-17T14:37:26.52+0000 [App/0] ERR goroutine 19 [finalizer wait]:
2014-11-17T14:37:26.52+0000 [App/0] ERR runtime.park(0x413710, 0x882018, 0x880289)
2014-11-17T14:37:26.52+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
2014-11-17T14:37:26.53+0000 [App/0] ERR runtime.parkunlock(0x882018, 0x880289)
2014-11-17T14:37:26.54+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
2014-11-17T14:37:26.54+0000 [App/0] ERR runfinq()
2014-11-17T14:37:26.54+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
2014-11-17T14:37:26.54+0000 [App/0] ERR runtime.goexit()
2014-11-17T14:37:26.54+0000 [App/0] ERR /usr/local/go/src/pkg/runtime/proc.c:1445
2014-11-17T14:37:26.54+0000 [App/0] ERR goroutine 20 [chan receive]:
2014-11-17T14:37:26.54+0000 [App/0] ERR code.google.com/p/log4go.ConsoleLogWriter.run(0xc208028000, 0x7fa52886f498, 0xc20802e008)
2014-11-17T14:37:26.54+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:27 +0x79
2014-11-17T14:37:26.54+0000 [App/0] ERR created by code.google.com/p/log4go.NewConsoleLogWriter
2014-11-17T14:37:26.54+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:19 +0x68
2014-11-17T14:37:26.54+0000 [App/0] ERR goroutine 21 [runnable]:
2014-11-17T14:37:26.54+0000 [App/0] ERR code.google.com/p/log4go.ConsoleLogWriter.run(0xc208028160, 0x7fa52886f498, 0xc20802e008)
2014-11-17T14:37:26.54+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:27 +0x79
2014-11-17T14:37:26.54+0000 [App/0] ERR created by code.google.com/p/log4go.NewConsoleLogWriter
2014-11-17T14:37:26.54+0000 [App/0] ERR /tmp/staged/app/.cf/go/src/code.google.com/p/log4go/termlog.go:19 +0x68
2014-11-17T14:37:26.63+0000 [DEA] ERR Instance (index 0) failed to start accepting connections
2014-11-17T14:37:26.64+0000 [API] OUT App instance exited with guid debf4f84-4499-46a8-942e-c241fa7f3eb7 payload: {"cc_partition"=>"default", "droplet"=>"debf4f84-4499-46a8-942e-c241fa7f3eb7", "version"=>"064efa65-aca4-487a-97dc-c8773bae4e7a", "instance"=>"3c13ce34c8d147378d3aadae7f370622", "index"=>0, "reason"=>"CRASHED", "exit_status"=>2, "exit_description"=>"app instance exited", "crash_timestamp"=>1416235046}
2014-11-17T14:37:35.00+0000 [DEA] OUT Removing crash for app with id debf4f84-4499-46a8-942e-c241fa7f3eb7
2014-11-17T14:37:35.00+0000 [DEA] OUT Stopping app instance (index 0) with guid debf4f84-4499-46a8-942e-c241fa7f3eb7
2014-11-17T14:37:35.00+0000 [DEA] OUT Stopped app instance (index 0) with guid debf4f84-4499-46a8-942e-c241fa7f3eb7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment