cdi-func-test-registry-host - a host that runs docker registry and is accessible from inside the cluster via
cdi-func-test-registry-host.kube-system host name. The registry is populated with images taken from /tmp/shared/images. It is used by functional tests.
Example of usage:
1. inspect
With skopeo acces registry to ispect image built from /tmp/shared/images/tinyCore.iso
skopeo inspect --tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso
2. Copy
skopeo copy --src-tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso dir:/tmp/download
Technical details:
Registry is run in a dedicated service cdi-func-test-registry-host.
In the same pod there are 3 containers:
1. cdi-func-test-registry - runs registry:2 with self signed certificate that listens on port 443
2. cdi-func-test-registry-init - used to pouplate /tmp/shared/images volume with images created from /test/images/tinuCore.iso and with certificate generated during container image build
3. cdi-func-test-registry-populate - encapsulted all images of /tmp/shared/images in docker images and pushes them to the registry
As a user, I want to specify a registry source to pre-populate my PV with a VM disk image.
* Using skopeo[1] cli to copy image from docker registry.
* Extracting image layers (tar files) into data folder.
* Cleaning up .wh. files and remove corresponding files.
* Supporting docker registries such as: docker hub, quay, etc.
[1] https://github.com/containers/skopeo
Change-Id: Ib4e20bb7be842ebaabeb925202402791827edfd3
Signed-off-by: Daniel Erez <derez@redhat.com>
Co-authored-by: Fred Rolland <frolland@redhat.com>
Added a note about running specific functional tests using
ginkgo command line options.
Change-Id: I5e1cb8f1f20fa170d2cf989870ee57c263e04f93
Signed-off-by: Daniel Erez <derez@redhat.com>
Remove the commented out code in run-lint-checks.sh, this was leftover
from when we were only linting the pkg directory, we've now extended
that out to the other .go folders in the project and this was commented
out but should've been removed.
This finishes up the last of the golint implementation, with the
addition of the cmd, tests and tools directories we are now running
golint tests on all of the current go source files in the project.
This change adds all the little fixes (mostly just commenting and
naming) and also enables the new diretories in the lint test that we
gate on.
- Removed file:// end points from code base.
- Updated unit tests to use httptest server instead of file://
- Refactored data stream unit tests to use ginko/gomega
When generating the CDI release manifest, allow the image names for the
controller, importer, and cloner pods to be changed.
Signed-off-by: Adam Litke <alitke@redhat.com>
This change just updates the common package to pass golint. Of course
that has some reaching implications into other packages with renaming of
constants.
I've intentionally kept this patch set to the bare minimum for the lint
test, I do think that we should put some effort into our use of
constants (especially those in common.go) in the future.
Ideally we'd declare constants where they're used, and we wouldn't
export them if they don't need to be. There are some in here that
are only used in one or two packages, and that can be cleaned up pretty
easily however it's likely that there might be plans to use them
elsewhere in the future.
- Fixed the retry counter not incrementing properly thus causing an
endless loop.
- Added printing of the pods every minute to help debug which pods are
not in the correct state.
Signed-off-by: Alexander Wels <awels@redhat.com>
Now that the updates have merged to fix golint errors in all of the
CDI pkgs (except common) turn on lint checks to keep things up to date.
This patch does that by:
1. Adding a check in hack/build/run-lint-checks.sh
NOTE: We temporarily set a list variable in the script to indicate
the directories that we've fixed and want to enforce. This will be
removed when common is "lintified"
2. Adding golint to our build containers Dockerfile
- Updated controller to use ENTRYPOINT (no cmd) instead of /bin/sh
- Updated Dockerfile to set path to /usr/bin/cloner_startup.sh instead of /tmp
- Updated Dockerfile to use ENTRYPOINT.
Fixed issue #374
Signed-off-by: Alexander Wels <awels@redhat.com>
* Unify redundant test scripts under test target and aliases
Remove func tests from travis - unsupported env
* func tests wrap generic test script
* address comments
- Added init/http docker images creation during sync
- Sync init/http image to cluster registry.
- Start http server service during sync.
- Clean up old install before sync.
Signed-off-by: Alexander Wels <awels@redhat.com>
- Added functional test framework similar to kubevirt one.
- Added basic sanity test to demonstrate framework.
- Updated some vendor packages.
Signed-off-by: Alexander Wels <awels@redhat.com>
* Add hash to cluster images
Signed-off-by: David Vossel <davidvossel@gmail.com>
* Set k8s-1.10.4 as default KUBEVIRT_PROVIDER
Signed-off-by: David Vossel <davidvossel@gmail.com>
- Added ability to call make cluster-up to start a kubevirt cluster.
- Added ability to call make cluster-down to stop a kubevirt cluster.
- Added ability to call make cluster-sync to build CDI and sync it with
the running cluster. This allows for testing during development.
- Added cli.sh and kubectl.sh just like kubevirt, in the CDI project to
manipulate a running cluster.
- You can use k8s or OCP providers like kubevirt.
Signed-off-by: Alexander Wels <awels@redhat.com>
* Size unit test
* add exceptions to Size functional tests
* rebase and minor
* exclude gz and xz
* fix unit tests
* no Printf in framework, new datastream subdir
* Added goveralls support for CI
* Add goveralls install to build container
* Small fix for manifest generation
* Fix symlinking bins
* goveralls only for PR merges
Adds go templated controller manifest
Adds make targets for template generation
Removes hard coded version values
Enables template generation and publishing in CI
* Use bash scripts to handle build workflow in docker containers
Added working docker builder/runner
Added _out to gitignore, stub script files
Added build and test scripts
small tweaks
Remove install opt, no need and create perm issues
Do func test for 'test' recipe, add non-docker option
Added QoL recipe alias, refactored test and build loops
centralized dockerfiles under hack/build/docker, renamed check/pre-check to format
Prefixed cmd/cdi- to main func files, added clean up scipt
simplified controller and importer dockerfiles, removed os/arch from bin name
DOCKER=1 - use docker
Travis and makefile changes
Don't go vet project in 'all' target (error in generated code), finished image builds
Small optimization to cdi-cloner image build
renamed build-images to build-docker; added make image aliases
testing version.sh
travis script calls new make targets, dropped version func (overly engineered for what we need)
deleted shift-tag.sh because it's just bad practice
Fix travis sed command
release :latest on PR merge
* Functional test refactoring
Removed test output files
renamed file vars to reflect purpose
Condensed test table definition, create tmp dir per test iteration
Refactored convertion funcs to write to a given directory, changed datastream test to create a temp dir and pass to file conversion, removed unused func
use randAlpahNum for tmp dir suffix, pepper in debug code
Must copy source file to tmp dir, then gzip/xzip, added debug code, package URL is deforming the file:// path by treating path[0] element as the server root
Fixed xz, gzip, tar, and noop test file generation; added copy of src to test dir if not present
Fixed typo in qemu-img cmd
Removed commented out line
* Added vet make target, updated hack/README
Make recipe call vet recipe
Updated hack/README
Makefile alias fix, clean all bin and _out except .gitignore, reverted 'vet' go_opt behavior
pulled 'vet' references from readme until it is fixed later
Don't delete the entire repo if _out doesn't exist,
* Moved clone script to cmd/ to make build flow smoother, now copy Dockerfiles to respective _out/cmd/* dirs for building container, delete old.Makefile
* Solidify build scripts
Text typos and comment additions
change cp glob to Dockerfile
Added push target to push images to non-kubevirt repo, updated README
Added license blocks, updated README with make vars, deleted empty script files
Added license to Makefile
Tweaked travis.yaml, removed version file (unused)
Fixed source paths
Fixing travis script sourcing
Moved shebang to line 1
Fixed shfmt install
Changed cloner script path in format.sh
Filter our vendor and pkg/client on go vet
Fix shfmt install in container, containerized clean target
Re-added Z opt to bind-mount
removed duplicate source line
Fix shfmt var expansion
formatting
Add non-docker cleanup optino
* wip: infer file formats
* add some of jon's code
* outer for loop; compiles
* closer... fix panic, rm processed known hdrs
* tar magic # fix
* nested rdrs,tar,qcow2 size work
* go-ify code
* size works for standalone test but not func-tests
* func test run
* gofmt and validate.go cleanup
* fix my bad rebase against 198
* review comments
* review2
* Place cdi packages under the top level kubevirt.io project path
Signed-off-by: David Vossel <davidvossel@gmail.com>
* Change all references to cdi.io to cdi.kubevirt.io
Signed-off-by: David Vossel <davidvossel@gmail.com>
* Add go_import_path to travis config
Signed-off-by: David Vossel <davidvossel@gmail.com>
* update test package imports
Signed-off-by: David Vossel <davidvossel@gmail.com>