Functional test for hyper cli.
use apirouter service on packet(dev env) or zenlayer(online env) as backend.
- Project status
- Test case name
- Command list
- Run test case
- cli_attach_test
- cli_attach_unix_test
- cli_config_test
- cli_create_test
- cli_commit_test
- cli_exec_test
- cli_exec_unix_test
- cli_fip_test
- cli_help_test
- cli_history_test
- cli_images_test
- cli_info_test
- cli_inspect_experimental_test
- cli_inspect_test
- cli_kill_test
- cli_links_test
- cli_links_unix_test
- cli_load_basic_test
- cli_load_large_test
- cli_load_legacy_test
- cli_load_local_test
- cli_login_test
- cli_logs_test
- cli_port_test
- cli_ps_test
- cli_pull_test
- cli_push_test
- cli_region_test
- cli_rename_test
- cli_restart_test
- cli_rm_test
- cli_rmi_test
- cli_run_test
- cli_run_unix_test
- cli_search_test
- cli_share_volume_test
- cli_snapshot_test
- cli_start_test
- cli_stats_test
- cli_version_test
- cli_volume_test
- api_attach_test
- api_containers_test
- api_create_test
- api_exec_test
- api_exec_resize_test
- api_images_test
- api_info_test
- api_inspect_test
- api_logs_test
- api_stats_test
- api_snapshots_test
- api_version_test
- api_volumes_test
not support build, tag
- cli_authz_unix_test
- cli_build_test
- cli_build_unix_test
- cli_by_digest_test
- cli_cp_from_container_test
- cli_cp_test
- cli_cp_to_container_test
- cli_cp_utils
- cli_daemon_test
- cli_diff_test
- cli_events_test
- cli_events_unix_test
- cli_experimental_test
- cli_export_import_test
- cli_external_graphdriver_unix_test
- cli_import_test
- cli_nat_test
- cli_netmode_test
- cli_network_unix_test
- cli_oom_killed_test
- cli_pause_test
- cli_proxy_test
- cli_pull_local_test
- cli_pull_trusted_test
- cli_save_load_test
- cli_save_load_unix_test
- cli_sni_test
- cli_start_volume_driver_unix_test
- cli_tag_test
- cli_top_test
- cli_update_unix_test
- cli_v2_only_test
- cli_volume_driver_compat_unix_test
- cli_wait_test
- TestCliConfig
- TestCliCreate
- TestCliCommit
- TestCliExec
- TestCliFip
- TestCliHelp
- TestCliHistory
- TestCliInfo
- TestCliInspect
- TestCliKill
- TestCliLinks
- TestCliLoadFromUrl
- TestCliLoadFromLocal
- TestCliLogin
- TestCliLogs
- TestCliPort
- TestCliPs
- TestCliPull
- TestCliPush
- TestCliRename
- TestCliRestart
- TestCliRmi
- TestCliRm
- TestCliRun
- TestCliSearch
- TestCliSnapshot
- TestCliStart
- TestCliVersion
- TestCliVolume
config fip snapshot
attach create exec history images
info inspect kill login logout
logs port ps pull rename
restart rm rmi run search
start stats stop version volume
not support for hyper currently
build commit cp diff events
export import load network pause
push save tag top unpause
update wait
$ git clone https://github.com/hyperhq/hypercli.git
build docker image in host OS Use
CentOSas test env Image name ishyperhq/hypercli-auto-test:dev
// run in dir hypercli/integration-cli on host os
$ ./util.sh build-dev
build hyper cli binary from source code
// run in dir hypercli/integration-cli on host os
$ ./util.sh make
update
ACCESS_KEYandSECRET_KEYinintegration-cli/util.conf
// run in dir hypercli/integration-cli on host os
$ ./util.sh enter
$ ./util.sh test all
// ensure hyperhq and docker dir
mkdir -p $GOPATH/src/github.com/{hyperhq,docker}
// clone and build hypercli
cd $GOPATH/src/github.com/hyperhq
git clone git@github.com:hyperhq/hypercli.git
cd hypercli
./build.sh
// copy hyper binary to /usr/bin/hyper
sudo cp hyper/hyper /usr/bin/hyper
// create link
cd $GOPATH/src/github.com/docker
ln -s ../hyperhq/hypercli docker
// generate util.conf
$ cd $GOPATH/src/github.com/hyperhq/hypercli
$ git checkout integration-test
$ cd integration-cli
$ ./util.sh
// config util.conf
$ vi util.conf
ACCESS_KEY="<hyper access key>"
SECRET_KEY="<hyper secret key>"
// run all test cases
$ ./util.sh test all
// run test case with timeout
$ ./util.sh test all -timout 20m
// run specified test case
$ ./util.sh test -check.f ^TestCliLoadFromLocalTar$
// run test cases start with specified prefix
$ ./util.sh test -check.f TestCliLoadFromLocalTar
// combined use
$ ./util.sh test -check.f 'TestCliLoadFromLocalTarEmpty|TestCliLoadFromLocalPullAndLoad' -timeout 20m
build docker image in host OS Use
CentOSas test env Image name ishyperhq/hypercli-auto-test:qa
// run in dir hypercli/integration-cli on host os
$ ./util.sh build-qa
run all test case for qa
$ cd integration-cli
//test master branch
$ ./util.sh qa
//test integration-test branch
$ ./util.sh qa integration-test
//test PR
$ ./util.sh qa "#222"
Required parameters:
APIROUTER: apirouter entrypoint
REGION: could be us-west-1(zl2), eu-central-1(eu1), RegionOne(packet)
ACCESS_KEY,SECRET_KEY: Hyper credential for test
BRANCH: hyper cli branch name or PR number
//test `master` branch of hypercli with `eu-west-1` apirouter
$ docker run -it --rm \
-e ACCESS_KEY=${ACCESS_KEY} \
-e SECRET_KEY=${SECRET_KEY} \
-e DOCKER_HOST=tcp://us-west-1.hyper.sh:443 \
-e REGION=us-west-1 \
-e BRANCH=master \
hyperhq/hypercli-auto-test:qa go test -check.f TestCli -timeout 180m
//test `specified PR`
$ docker run -it --rm \
-e DOCKER_HOST=${APIROUTER} \
-e REGION=${REGION} \
-e ACCESS_KEY=${ACCESS_KEY} \
-e SECRET_KEY=${SECRET_KEY} \
-e BRANCH="#221" \
hyperhq/hypercli-auto-test:qa go test -check.f TestCli -timeout 180m
//test `specified case name`
$ docker run -it --rm \
-e DOCKER_HOST=${APIROUTER} \
-e REGION=${REGION} \
-e ACCESS_KEY="${ACCESS_KEY}" \
-e SECRET_KEY="${SECRET_KEY}" \
-e BRANCH=${BRANCH} \
hyperhq/hypercli-auto-test:qa go test -check.f 'TestCliInfo|TestCliFip' -timeout 180m
//test with `packet` apirouter
$ docker run -it --rm \
-e ACCESS_KEY=${ACCESS_KEY} \
-e SECRET_KEY=${SECRET_KEY} \
-e BRANCH=${BRANCH} \
-e DOCKER_HOST=tcp://147.75.x.x:6443 \
-e REGION=RegionOne \
hyperhq/hypercli-auto-test:qa go test -check.f TestCli -timeout 180m
//test with http proxy
$ docker run -it --rm \
-e DOCKER_HOST=${APIROUTER} \
-e REGION=${REGION} \
-e ACCESS_KEY=${ACCESS_KEY} \
-e SECRET_KEY=${SECRET_KEY} \
-e BRANCH=${BRANCH} \
-e http_proxy=${http_proxy} \
-e https_proxy=${https_proxy} \
hyperhq/hypercli-auto-test:qa go test -check.f TestCliInfo
//test basic test case only
$ docker run -it --rm \
-e DOCKER_HOST=${APIROUTER} \
-e REGION=${REGION} \
-e ACCESS_KEY=${ACCESS_KEY} \
-e SECRET_KEY=${SECRET_KEY} \
-e BRANCH=${BRANCH} \
hyperhq/hypercli-auto-test:qa go test -check.f "TestCli.*Basic" -timeout 180m
Just replace docker with hyper in command line.