#!/bin/bash # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Perform preparations required to run e2e tests proc prepare-e2e { echo "Local doesn't need special preparations for e2e tests" !1 > !2 } # Must ensure that the following ENV vars are set proc detect-master { export KUBE_MASTER_IP="127.0.0.1" export KUBE_MASTER="localhost" } proc detect-master { global KUBE_MASTER := 'localhost' global KUBE_MASTER_IP := '127.0.0.1' global KUBE_MASTER_URL := ""http://$(KUBE_MASTER_IP):8080"" echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)" } (CommandList children: [ (FuncDef name: prepare-e2e body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Local doesn't need special preparations for e2e tests"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[61])] ) ] spids: [52] ) spids: [46 51] ) (FuncDef name: detect-master body: (BraceGroup children: [ (C {(export)} {(Lit_VarLike "KUBE_MASTER_IP=") (DQ (127.0.0.1))}) (C {(export)} {(Lit_VarLike "KUBE_MASTER=") (DQ (localhost))}) ] spids: [74] ) spids: [70 73] ) (FuncDef name: detect-master body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MASTER) op: Equal rhs: {(localhost)} spids: [102] ) ] spids: [102] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MASTER_IP) op: Equal rhs: {(127.0.0.1)} spids: [106] ) ] spids: [106] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MASTER_URL) op: Equal rhs: {(DQ ("http://") (${ VSub_Name KUBE_MASTER_IP) (":8080"))} spids: [110] ) ] spids: [110] ) (C {(echo)} { (DQ ("Using master: ") ($ VSub_Name "$KUBE_MASTER") (" (external IP: ") ($ VSub_Name "$KUBE_MASTER_IP") (")") ) } ) ] spids: [99] ) spids: [95 98] ) ] )