Commit Graph

65 Commits

Author SHA1 Message Date
Anoop C S
1589706287 Makefile: Use ?= for initial variable definitions
:= is not capable of accepting values(for variables) from execution
environment. Therefore replace := with ?= for completeness.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-06-30 18:20:09 +00:00
Anoop C S
38862c0c7a makefile: use "pacific" as our default ceph version
"quincy" is already out which will then make "octopus" EOL very soon.
Therefore default to "pacific" instead.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-06-24 16:01:11 +00:00
John Mulligan
37ba163aae makefile: allow testing with unreleased quincy containers
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
John Mulligan
70c7197d39 makefile: initial support for ceph quincy
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-05-02 14:14:25 +00:00
Sven Anderson
05b4e70014 cutil: enable PtrGuard by default
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-04-28 14:39:48 +00:00
John Mulligan
737dee7a4d makefile: add common/admin/nfs pkg to test bins
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-04-06 17:56:33 +00:00
John Mulligan
c3f2bc9932 makefile: add internal/commands pkg to list of test-bins
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-04-06 17:56:33 +00:00
Sven Anderson
f6eeb68e33 contrib/implements: move into independent module
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-21 14:45:42 +00:00
Sven Anderson
397ea777b9 contrib/implements: minor meta fixes
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-21 14:45:42 +00:00
John Mulligan
0757a9acf9 makefile: add new common/admin/manager pkg for tests build
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
Sven Anderson
63ae1fcbde Makefile: make revive check independent of build tags
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-08 15:17:34 +00:00
Sven Anderson
b8695c037c make: always rebuild implements.json
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-01 14:39:34 +00:00
John Mulligan
dfba5f5bb0 makefile: add a rule to clean up implements binary
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan
5d1ec1d64f makefile: generate implements.json if not present
Add new rules to build/run the implements tool via the test container,
an only the implements tool, when apiage is to be run and the
implements.json is not present.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan
3c874e078d makefile: add rules for managing api stability docs
The rules added to the makefile help contributors and maintainers follow
the recent api stability policy by allowing one to check the state,
update the state (using the git tags for versioning info) and update
only the generated markdown doc.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-11-09 02:02:08 +00:00
John Mulligan
8835a26c9b makefile: support NO_PREVIEW env var
Following on the previous change, the NO_PREVIEW var can be set to skip
testing with preview functions. We default to testing with preview
functions.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-22 11:42:22 +00:00
John Mulligan
ac2e61a699 makefile: add a variable for passing additional container build options
The one I often use is "--no-cache" to force a rebuild. Adding a var to
the makefile makes it so I don't have to get too hacky with it.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-02 13:53:09 +00:00
John Mulligan
c7fb7aaa7c makefile: determine CEPH_TAG based on CEPH_VERSION
For go-ceph's purposes we prefer the series codename so we can simply
derive CEPH_TAG from CEPH_VERSION in the makefile.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-02 13:53:09 +00:00
John Mulligan
cdbffdc229 makefile: expand test-multi-container into multiple test-containers-* rules
This change adds a whole family of test-containers-* rules. The role
meant to be used directly "test-containers-test" brings up the
required dependencies once, and will reuse them on subsequent runs.
The targets "test-containers-kill" and "test-containers-clean" will
remove just the ceph containers and all dependencies respectively.

The change may look big, and I did shorten some lines, thus lengthening
the makefile vertically, but the logic is basically the same as before.
One can continue using "test-multi-container" and it should behave
pretty much as before, but outside the CI when working on code or
testing things out using the more granular rules can help speed things
up.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-08-25 15:15:48 +00:00
John Mulligan
c009f6d19e makefile: add a flag to run go commands via a container
By running `make USE_GOCO=1` the makefile will run go build, etc.
commands using _GO_ from a _COntainer_. This is inspired by recent work
to enable development containers for VSCode, but is more aimed at
vim/cli users like myself who want to compile the code via makefile
rules and make use of vim's quickfix feature without having to have ceph
libs or, more importantly, the right version of the ceph libs, locally.

Full example: `make build test-bins USE_CACHE=1 USE_GOCO=1`

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-08 10:36:19 -04:00
John Mulligan
7abb5fd321 makefile: use variables for go and gofmt commands
There are use cases where the default go commands are not what you want,
including an upcoming change. This simply "variablizes" the makefile.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-08 10:36:19 -04:00
Sven Anderson
5cb1f79d74 tests: add USE_CACHE variable to enable go packages cache
If the make variable USE_CACHE is set, the test container will mount
the /go directory from a named volume that is reused in following
test runs, so that go dependencies don't have to be installed again.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-06-14 14:16:42 +00:00
John Mulligan
e0e56486b0 makefile: add new rbd/admin package to build and ci script
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-01 11:06:19 +00:00
Sébastien Han
edd90d8de4 make: set hostname for "test-container" test
We now set the hostname for the "test-container" to "test_ceph_aio"
where "aio" means "all in one". This will be useful for the rgw test
where we need an hostname to reach out to the endpoint.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-31 17:45:31 +02:00
John Mulligan
986dcab058 makefile: use "octopus" as our default ceph version
We're adding a fair amount of octopus (and later) only features now, and
at the time of this writing, pacific is already out. Stop defaulting to
nautilus and default to octopus instead.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-05-03 15:37:43 +00:00
John Mulligan
7c19066bed makefile: remove the use of fuse from multi container tests
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-04-23 13:07:21 +00:00
John Mulligan
312e4cf6b5 Makefile: allow passing arguments to the test container
Allow passing additional arguments for the entrypoint.sh script to
the test container. This is useful to limit the test run to
a single package with `--test-pkg=<X>` for example.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-04-19 14:01:58 -04:00
John Mulligan
fc9bd71eb3 Makefile: workaround for running dual containers with podman
When running the new test-multi-container make rule, I found that
podman generated "random" hex based hostnames for the containers.
These names work internally and do resolve but I found that putting
these in the ceph config files does not work as ceph sees them as
addresses, not hostnames, presumably due to the hex.
This change simply specifies the hostnames manually on the cli
so that both podman and docker should match docker's default behavior.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-04-19 14:01:58 -04:00
Sven Anderson
0cc1dcb90d ci: add optional mirroring setup entrypoint.sh
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-04-06 08:59:55 -04:00
Sven Anderson
9bd143e06e ci: add test-multi-container Makefile target
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-04-06 08:59:55 -04:00
John Mulligan
78ee562863 makefile: remove /dev/fuse and SYS_ADMIN cap from test
When invoking podman/docker/etc. it is no longer needed to add fuse
support, or (AFAICT) keeping cap SYS_ADMIN.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-03-21 06:19:40 +00:00
Sven Anderson
5768911be7 ci: add a test run for Iovec based on PtrGuard
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-02-08 11:09:25 -05:00
Yang Honggang
f3e39224ec Makefile: fix "No such file or directory" error
$ make test-docker
grep: /sys/kernel/security/lsm: No such file or directory

Signed-off-by: Yang Honggang <yanghonggang@kuaishou.com>
2020-12-23 13:29:22 +00:00
John Mulligan
1e4c2d09ae makefile: add new package to makefile and entrypoint.sh
Integrate the new 'cephfs/admin' package with existing makefile rules
and entrypoint.sh for testing.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-08-31 10:38:38 -04:00
Sven Anderson
2a75461371 make: add micro-osd.sh to container dependencies
Signed-off-by: Sven Anderson <sven@redhat.com>
2020-08-04 12:59:38 -04:00
John Mulligan
3a0bacb039 makefile: remove check-ceph-version which is no longer neeeded
The per-ceph-version buildfiles remove the need for this rule.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-16 16:02:13 -04:00
John Mulligan
d213fb3e02 makefile: pass -tags to go test lines too
I noticed that the make target I use for smoke testing things locally
was failing due to new octopus related vars. This was due to the go test
lines in the makefile not passing tags for the maximum ceph version.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-16 16:02:13 -04:00
John Mulligan
610c37f05e makefile: remove trailing whitespace
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-16 16:02:13 -04:00
John Mulligan
38e9b9a260 makefile: automatically select docker or podman container tools
After having forgot to explicitly pass CONTAINER_CMD for the millionth
time I figured copying ceph-csi a smidgen and automatically selecting
podman or docker based on availability would be save me some typing.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-16 16:02:13 -04:00
John Mulligan
68f8ce2fee makefile: support using multiple base images at one time
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-16 16:02:13 -04:00
John Mulligan
b450208827 makefile: add rule to run implements tool
Right now the tool doesn't do much checking but it does check what is
implemented, so we call the rule 'check-implements'. All current
sub-packages are checked. Use IMPLEMENTS_OPTS to pass additional cli
options to the tool.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan
c3b3290fb4 makefile: add rule to build implements tool
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan
e2b1139310 makefile: include formatting as part of "make check"
Previously, "make check" only ran revive and its static checks.  The
entrypoint.sh script ran a formatting check *after* setting up ceph.

Now, "make check" runs both revive and gofmt. New make rules
check-revive and check-format run the individual tools respectively.
This is done to quicken the feedback in both the CI and locally for
formatting mistakes. Users can now easily run `make check
test-container` and avoid a long wait to set up ceph just to find out
there was a silly formatting error present.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-15 10:20:35 -04:00
John Mulligan
7256dbb27b entrypoint: enable building and testing of internal/cutil package
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-12 17:18:08 -04:00
muagarwa
301d8e427f Makefile: Fix CONTAINER_OPTS for Fedora
make test-container is failing on Fedora based distribution because of bad label option "disabled".
Change label option to "disable"

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2020-04-23 08:22:07 -04:00
John Mulligan
204a7558d4 makefile: support getting results locally from container test
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-21 15:56:40 -04:00
Sven Anderson
e01eb03284 retry: add a helper lib for retrying common operations
Our first operation is generating sizes for various caller-allocated
buffers.  The WithSizes function "suggests" sizes to an anonymous
function that takes a size as an argument and returns a hint how
sucessful the attempt was.  If required the same function is called
again with a larger size.  Errors and other results of that anonymous
function are "communicated" with variables of the surrounding scope
in wich the function is defined.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: Sven Anderson <sven@redhat.com>
2020-04-20 15:08:36 -04:00
John Mulligan
973def5658 makefile: remove shell loop that was ignoring errors
revive would only fail if rbd had errors due to the loop being in shell.
Now we expand the modules list as arguments to revive which then
invokes revive only once and properly handles errors.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-07 13:55:51 -04:00
John Mulligan
71d533d14f makefile: no need to require a tty for running tests
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-07 13:55:51 -04:00
John Mulligan
825f07583e makefile: use ceph based containers by default
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-03-12 13:33:16 +01:00