Skip to content

Instantly share code, notes, and snippets.

View stevekuznetsov's full-sized avatar

Steve Kuznetsov stevekuznetsov

  • Microsoft
  • United States
  • 01:37 (UTC -06:00)
View GitHub Profile
@stevekuznetsov
stevekuznetsov / test.log
Created January 14, 2016 22:02
trap test log
$ hack/test/trap
++ dirname hack/test/trap
+ OS_ROOT=hack/test/../..
+ source hack/test/../../hack/cmd_util.sh
++ source hack/test/../../hack/text.sh
++ source hack/test/../../hack/util.sh
+++ source hack/test/../../hack/lib/util/trap.sh
++++ os::util::trap::internal::init
++++ declare -A REGISTERED_TRAPS_TO_SIGNALS
++++ export REGISTERED_TRAPS_TO_SIGNALS
@stevekuznetsov
stevekuznetsov / arrays.sh
Created January 14, 2016 21:46
associative array failure
#!/bin/bash
declare -o nounset
declare -A some_array
echo "${some_array[some_key]-}" # this is OK
some_array[some_other_key]=some_val # this is OK
echo "${some_array[some_key]}" # this is *not* OK
@stevekuznetsov
stevekuznetsov / report.xml
Created January 7, 2016 15:49
build controller junit output
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="github.com/openshift/origin/pkg/build/controller" tests="28" skipped="0" failures="0" time="0.01">
<propery name="coverage.statements.pct" value="86.3"></propery>
<propery name="coverage.statements.pct" value="86.3"></propery>
<testcase name="TestHandleBuildConfig" time="0"></testcase>
<testcase name="TestHandleBuild" time="0"></testcase>
<testcase name="TestHandlePod" time="0"></testcase>
<testcase name="TestCancelBuild" time="0"></testcase>
<testcase name="TestHandleHandleBuildDeletionOK" time="0"></testcase>
I1215 15:15:13.013107 1 builder.go:41] $BUILD env var is {"kind":"Build","apiVersion":"v1","metadata":{"name":"openldap-1","namespace":"openldap","selfLink":"/oapi/v1/namespaces/openldap/builds/openldap-1","uid":"a2d05caa-a33e-11e5-88da-54ee753e2644","resourceVersion":"309","creationTimestamp":"2015-12-15T15:15:11Z","labels":{"buildconfig":"openldap","name":"openldap","openshift.io/build-config.name":"openldap"},"annotations":{"openshift.io/build.number":"1"}},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"git://github.com/openshift/origin.git","ref":"master"},"contextDir":"images/openldap"},"strategy":{"type":"Docker","dockerStrategy":{"from":{"kind":"DockerImage","name":"openshift/openldap-2441-centos7@sha256:b70177b808d84eeddde8ea6ebc0c8b27a03027e80f69e655c4ca3f6920db2a25"}}},"output":{"to":{"kind":"DockerImage","name":"172.30.173.179:5000/openldap/openldap-testenv:latest"},"pushSecret":{"name":"builder-dockercfg-jpsmj"}},"resources":{}},"status":{"phase":"New","outputDockerI
@stevekuznetsov
stevekuznetsov / test.sh
Created November 5, 2015 14:43
MWE for fail
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
source test/cmd/util.sh
output=$(expect_code 'exit 1' '0' 2>&1 || true)
HOSTNAME=7c783e03c16c
TERM=xterm
OLDPWD=/root/go/src/github.com/openshift/origin
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35
@stevekuznetsov
stevekuznetsov / govet.sh
Created October 15, 2015 14:11
hack-verify-govet.sh
#!/bin/bash
set -o nounset
set -o pipefail
function exit_func() {
echo "exiting from $?"
}
trap exit_func EXIT
$ oc get pods
NAME READY STATUS RESTARTS AGE
openldap-base-2-build 0/1 Error 0 8m
$ oc logs openldap-base-2-build --loglevel=1000
I1008 10:02:47.569776 18420 debugging.go:101] curl -k -v -XGET -H "User-Agent: oc/v1.1.0 (linux/amd64) kubernetes/86b4e77" -H "Authorization: Bearer Dk1R1IqTz57qWUHxdbtZ31SA2x1MFyOOPMaNTb5440Y" https://localhost:8443/api
I1008 10:02:47.583678 18420 debugging.go:120] GET https://localhost:8443/api 200 OK in 13 milliseconds
I1008 10:02:47.583701 18420 debugging.go:126] Response Headers:
I1008 10:02:47.583707 18420 debugging.go:129] Cache-Control: no-store
I1008 10:02:47.583712 18420 debugging.go:129] Content-Type: application/json
I1008 10:02:47.583718 18420 debugging.go:129] Date: Thu, 08 Oct 2015 14:02:47 GMT
@stevekuznetsov
stevekuznetsov / branch-dependent-openldap-builds.json
Created October 8, 2015 13:48
branch dependent openldap build chain
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "openldap",
"creationTimestamp": null,
"annotations": {
"description": "OpenLDAP build and test build",
"tags": "openldap"
}
@stevekuznetsov
stevekuznetsov / dump.txt
Created October 6, 2015 18:54
openldap debug dump
This file has been truncated, but you can view the full file.
$ docker run -e OPENLDAP_DEBUG_LEVEL=-1 openshift/openldap-2441-centos7
+ ulimit -n 1024
+ OPENLDAP_ROOT_PASSWORD=admin
+ OPENLDAP_ROOT_DN_RREFIX=cn=Manager
+ OPENLDAP_ROOT_DN_SUFFIX=dc=example,dc=com
+ OPENLDAP_DEBUG_LEVEL=-1
+ '[' '!' -f /etc/openldap/CONFIGURED ']'
++ id
++ grep -Po '(?<=uid=)\d+'
+ user=0