From a016ec6fd168016d94d6cfd1e2189f8c25f6de1f Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Wed, 16 Dec 2015 09:58:20 -0800 Subject: [PATCH] update and run vendor script so there was weird whitespacing that got messed up the last time this was run, this fixes that and cleans up vendor helpers as well :) Signed-off-by: Jessica Frazelle --- hack/.vendor-helpers.sh | 9 +- .../src/github.com/docker/libnetwork/machines | 111 ++++++++++++++++++ vendor/src/github.com/miekg/pkcs11/const.go | 2 +- vendor/src/github.com/miekg/pkcs11/pkcs11.h | 6 +- vendor/src/github.com/miekg/pkcs11/pkcs11f.h | 16 +-- 5 files changed, 125 insertions(+), 19 deletions(-) create mode 100755 vendor/src/github.com/docker/libnetwork/machines diff --git a/hack/.vendor-helpers.sh b/hack/.vendor-helpers.sh index 34bab360b6..e3be72bc81 100755 --- a/hack/.vendor-helpers.sh +++ b/hack/.vendor-helpers.sh @@ -105,11 +105,8 @@ clean() { export GOOS="${platform%/*}"; export GOARCH="${platform##*/}"; for buildTags in "${buildTagCombos[@]}"; do - pkgs=( $(go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u) ) - pkgs+=( ${packages[@]} ) - testImports=( $(go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${pkgs[@]}" | sort -u) ) - printf '%s\n' "${testImports[@]}" - go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]} ${testImports[@]}" + go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" + go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}" done done | grep -vE "^${PROJECT}" | sort -u ) ) @@ -120,8 +117,6 @@ clean() { findArgs=( # This directory contains only .c and .h files which are necessary -path vendor/src/github.com/mattn/go-sqlite3/code - # This directory is needed for compiling the unit tests - -o -path vendor/src/github.com/stretchr/objx ) for import in "${imports[@]}"; do [ "${#findArgs[@]}" -eq 0 ] || findArgs+=( -or ) diff --git a/vendor/src/github.com/docker/libnetwork/machines b/vendor/src/github.com/docker/libnetwork/machines new file mode 100755 index 0000000000..4d4b407ec1 --- /dev/null +++ b/vendor/src/github.com/docker/libnetwork/machines @@ -0,0 +1,111 @@ +#/bin/sh + +set -e + +usage() +{ +cat << EOF +NAME: + machines - Create Test Environments for Docker Networking + +VERSION: + 0.1 + +USAGE: + $0 [command_options] [arguments...] + +COMMANDS: + help + Help and usage + + up + Create environment with given KV store + zookeeper | etcd | consul (default) + Create N nodes, default = 2 + + destroy + Destroy Environment + +EOF +} + +step() { + printf "\033[0;36m-----> $@\033[0m\n" +} + +up() +{ + step "Creating KV Store Machine" + docker-machine create \ + -d virtualbox \ + mh-kv + + step "KV Store is $1" + step "Starting KV Container" + case "$1" in + etcd) + cluster_store="cluster-store=etcd://$(docker-machine ip mh-kv):2379" + docker $(docker-machine config mh-kv) run -d \ + -p "2379:2379" \ + -h "etcd" \ + --name "etcd" \ + quay.io/coreos/etcd:v2.2.1 \ + --listen-client-urls="http://0.0.0.0:2379" \ + --advertise-client-urls="http://$(docker-machine ip mh-kv):2379" + ;; + zookeeper) + cluster_store="cluster-store=zk://$(docker-machine ip mh-kv):2181" + docker $(docker-machine config mh-kv) run -d \ + -p "2181:2181" \ + -h "zookeeper" \ + --name "zookeeper" \ + tianon/zookeeper + ;; + *) + cluster_store="cluster-store=consul://$(docker-machine ip mh-kv):8500" + docker $(docker-machine config mh-kv) run -d \ + -p "8500:8500" \ + -h "consul" \ + --name "consul" \ + progrium/consul -server -bootstrap-expect 1 + ;; + esac + + machines=$2 + if [ -z machines ]; then + machines=2 + fi + step "Creating $machines Machines" + + for i in $(seq $machines); do + step "Creating machine $i" + docker-machine create \ + -d virtualbox \ + --engine-opt="cluster-advertise=eth1:2376" \ + --engine-opt="$cluster_store" \ + mh-$i + done +} + +destroy() +{ + for x in $(docker-machine ls | grep mh- | awk '{ print $1 }'); do + docker-machine rm $x + done +} + +case "$1" in + up) + shift + up $@ + ;; + destroy) + destroy $@ + ;; + help) + usage + ;; + *) + usage + ;; +esac diff --git a/vendor/src/github.com/miekg/pkcs11/const.go b/vendor/src/github.com/miekg/pkcs11/const.go index 5371e24d54..79a25e345d 100644 --- a/vendor/src/github.com/miekg/pkcs11/const.go +++ b/vendor/src/github.com/miekg/pkcs11/const.go @@ -25,7 +25,7 @@ const ( // Generated with: awk '/#define CK[AFKMR]/{ print $2 "=" $3 }' pkcs11t.h -// All the flag (CKF_), attribute (CKA_), error code (CKR_), key type (CKK_) and +// All the flag (CKF_), attribute (CKA_), error code (CKR_), key type (CKK_) and // mechanism (CKM_) constants as defined in PKCS#11. const ( CKF_TOKEN_PRESENT = 0x00000001 diff --git a/vendor/src/github.com/miekg/pkcs11/pkcs11.h b/vendor/src/github.com/miekg/pkcs11/pkcs11.h index 3283bdc893..9261e1e4c3 100644 --- a/vendor/src/github.com/miekg/pkcs11/pkcs11.h +++ b/vendor/src/github.com/miekg/pkcs11/pkcs11.h @@ -7,10 +7,10 @@ * License is also granted to make and use derivative works provided that * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or + * Cryptographic Token Interface (Cryptoki)" in all material mentioning or * referencing the derived work. - * RSA Security Inc. makes no representations concerning either the + * RSA Security Inc. makes no representations concerning either the * merchantability of this software or the suitability of this software for * any particular purpose. It is provided "as is" without express or implied * warranty of any kind. @@ -275,7 +275,7 @@ extern "C" { #define CK_PKCS11_FUNCTION_INFO(name) \ __PASTE(CK_,name) name; - + struct CK_FUNCTION_LIST { CK_VERSION version; /* Cryptoki version */ diff --git a/vendor/src/github.com/miekg/pkcs11/pkcs11f.h b/vendor/src/github.com/miekg/pkcs11/pkcs11f.h index 6f65a90e94..ffbe010f64 100644 --- a/vendor/src/github.com/miekg/pkcs11/pkcs11f.h +++ b/vendor/src/github.com/miekg/pkcs11/pkcs11f.h @@ -7,10 +7,10 @@ * License is also granted to make and use derivative works provided that * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or + * Cryptographic Token Interface (Cryptoki)" in all material mentioning or * referencing the derived work. - * RSA Security Inc. makes no representations concerning either the + * RSA Security Inc. makes no representations concerning either the * merchantability of this software or the suitability of this software for * any particular purpose. It is provided "as is" without express or implied * warranty of any kind. @@ -562,7 +562,7 @@ CK_PKCS11_FUNCTION_INFO(C_Sign) /* C_SignUpdate continues a multiple-part signature operation, - * where the signature is (will be) an appendix to the data, + * where the signature is (will be) an appendix to the data, * and plaintext cannot be recovered from the signature. */ CK_PKCS11_FUNCTION_INFO(C_SignUpdate) #ifdef CK_NEED_ARG_LIST @@ -574,7 +574,7 @@ CK_PKCS11_FUNCTION_INFO(C_SignUpdate) #endif -/* C_SignFinal finishes a multiple-part signature operation, +/* C_SignFinal finishes a multiple-part signature operation, * returning the signature. */ CK_PKCS11_FUNCTION_INFO(C_SignFinal) #ifdef CK_NEED_ARG_LIST @@ -623,12 +623,12 @@ CK_PKCS11_FUNCTION_INFO(C_VerifyInit) ( CK_SESSION_HANDLE hSession, /* the session's handle */ CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ - CK_OBJECT_HANDLE hKey /* verification key */ + CK_OBJECT_HANDLE hKey /* verification key */ ); #endif -/* C_Verify verifies a signature in a single-part operation, +/* C_Verify verifies a signature in a single-part operation, * where the signature is an appendix to the data, and plaintext * cannot be recovered from the signature. */ CK_PKCS11_FUNCTION_INFO(C_Verify) @@ -644,7 +644,7 @@ CK_PKCS11_FUNCTION_INFO(C_Verify) /* C_VerifyUpdate continues a multiple-part verification - * operation, where the signature is an appendix to the data, + * operation, where the signature is an appendix to the data, * and plaintext cannot be recovered from the signature. */ CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) #ifdef CK_NEED_ARG_LIST @@ -770,7 +770,7 @@ CK_PKCS11_FUNCTION_INFO(C_GenerateKey) #endif -/* C_GenerateKeyPair generates a public-key/private-key pair, +/* C_GenerateKeyPair generates a public-key/private-key pair, * creating new key objects. */ CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) #ifdef CK_NEED_ARG_LIST