Skip to content

Instantly share code, notes, and snippets.

@ramr
ramr / installer-wait-test-v2
Last active October 25, 2018 06:03
wait test for installer
$ cat t1.sh
#/bin/bash
KUBECONFIG=/home/ramr/work/redhat/src/github.com/openshift/installer/clusters/openshift-dev-ramr/auth/kubeconfig
ROUTER_NAMESPACE=openshift-ingress
ROUTER_DEPLOYMENT="ds/router-default"
echo " - delete "
oc delete $(oc get pods -n openshift-ingress -o name) -n openshift-ingress
@ramr
ramr / installer-wait-test
Created October 24, 2018 21:52
test for installer wait
$ oc delete $(oc get pods -n openshift-ingress -o name) -n openshift-ingress ; \
oc get pods -n openshift-ingress ; oc get all -n openshift-ingress; \
echo " - test with next command that should timeout"; \
time oc --request-timeout=10s rollout status "${ROUTER_DEPLOYMENT}" -n "${ROUTER_NAMESPACE}" -w; \
echo " - test with next command tht should finish ... "; \
oc get all -n openshift-ingress; \
time oc --request-timeout=2m rollout status "${ROUTER_DEPLOYMENT}" -n "${ROUTER_NAMESPACE}" -w
pod "router-default-72lqm" deleted
pod "router-default-jsr6f" deleted
@ramr
ramr / clusterdns op integration test
Created October 3, 2018 01:19
clusterdns op integration test
[ramr@f28 cluster-dns-operator (cached:installer-config:c-1:s-0+10:o-4)]$ KUBECONFIG=/home/ramr/work/redhat/src/github.com/openshift/release/cluster/test-deploy/gcp-dev/admin.kubeconfig make test-integration
go test -v -tags integration ./test/integration
=== RUN TestIntegration
=== RUN TestIntegration/TestDNSRecords
time="2018-10-02T18:15:04-07:00" level=error msg="Getting cluster dns ip: getting cluster-config-v1 resource: configmaps \"cluster-config-v1\" not found"
E1002 18:15:21.631124 11334 reflector.go:322] github.com/openshift/cluster-dns-operator/vendor/github.com/operator-framework/operator-sdk/pkg/sdk/informer.go:91: Failed to watch *unstructured.Unstructured: the server could not find the requested resource
--- PASS: TestIntegration (25.39s)
integration_test.go:268: Watching dns.openshift.io/v1alpha1, ClusterDNS, default, 600000000000
--- PASS: TestIntegration/TestDNSRecords (16.96s)
integration_test.go:117: configured cluster domain: test-cluster.local, clusterIP: 172.30.182.25:53
@ramr
ramr / healthz-tests
Created September 6, 2018 00:12
healthz test
#!/bin/bash
echo " - Test 1: [gG][eE][tT] "
echo " - Test 1.1: Get"
echo "Get /healthz HTTP/1.1
host:apps.ocp.example.com
connection:close
" | socat stdio TCP4:127.0.0.1:1936
echo ""
@ramr
ramr / haproxy http2 support tests
Created June 11, 2018 23:15
haproxy http2 support tests
$ curl -k --http2 -vvv --resolve edge.header.test:443:127.0.0.1 https://edge.header.test/
* Added edge.header.test:443:127.0.0.1 to DNS cache
* Hostname edge.header.test was found in DNS cache
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to edge.header.test (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: PROFILE=SYSTEM
* successfully set certificate verify locations:
@ramr
ramr / router-reload-errors
Created February 13, 2018 03:30
router reload errors
I0205 23:57:32.666042 1 router.go:441] Router reloaded:
- Checking http://localhost:80 ...
- Health check ok : 0 retry attempt(s).
E0205 23:57:50.812857 1 limiter.go:137] error reloading router: exit status 1[
ALERT] 035/235750 (20907) : parsing [/var/lib/haproxy/conf/haproxy.config:120] : 'bind 127.0.0.1:10444' : 'crt-list' : error processing line 243 in file '/var/lib/haproxy/conf/cert_config.map' : unable to load SSL certificate file '/var/lib/haproxy/router/certs/default:header-test-route-2.pem' file does not exist.
[ALERT] 035/235750 (20907) : Error(s) found in configuration file : /var/lib/haproxy/conf/haproxy.config
[ALERT] 035/235750 (20907) : Fatal errors found in configuration.
E0205 23:57:55.726851 1 limiter.go:137] error reloading router: exit status 1
[ALERT] 035/235755 (20926) : parsing [/var/lib/haproxy/conf/haproxy.config:120] : 'bind 127.0.0.1:10444' : 'crt-list' : error processing line 279 in file '/var/lib/haproxy/conf/cert_config.map' : unable to load SSL certificate fi
@ramr
ramr / updated elastic search index info
Created August 2, 2017 08:15
update elastic search index info
curl -XGET 'localhost:9200/meteor_namespace/resourceTypes/CHEBI_10?pretty'
{
"_index" : "meteor_namespace",
"_type" : "resourceTypes",
"_id" : "CHEBI_10",
"_version" : 3,
"found" : true,
"_source" : {
"additional_properties" : {
"alkaloid_id" : {
@ramr
ramr / config snippet for connector.json
Last active August 2, 2017 08:09
connector json config snippet for plugin support
{
"continueOnError": true,
"verbosity": 2,
"namespaces": {
/* Other collection info ... */
"meteor_namespace.runData": {
"plugins": [
{
"pluginName": "UpdateElasticsearchIndex",
"info": {
@ramr
ramr / reproduce-eq-panic.sh
Created February 10, 2017 00:29
reproduce-eq-panic.sh test script
$ cat reproduce-eq-panic.sh
#!/bin/bash
function _simulate_eq_panic() {
sleep 0.0$((RANDOM%3))
echo " - worker name: $1 ... "
case "$((RANDOM%3))" in
0) oc create -f "$2" ;;
@ramr
ramr / eventqueue error
Created February 8, 2017 21:13
eventqueue error
$ cat pkg/client/cache/ramr_eq_test.go
package cache
import (
"testing"
"k8s.io/kubernetes/pkg/watch"
)
type qEntry struct {