SUSE / connect-ng

Other
9 stars 14 forks source link

SUSEConnect-ng

build result

SUSEConnect is a Golang command line tool for connecting a client system to the SUSE Customer Center. It will connect the system to your product subscriptions and enable the product repositories/services locally.

SUSEConnect-ng reduces the size of its runtime dependencies compared to the replaced Ruby SUSEConnect.

SUSEConnect-ng is distributed as RPM for all SUSE distributions and gets built in the openSUSE build service.

Please visit https://scc.suse.com to see and manage your subscriptions.

SUSEConnect-ng communicates with SCC over this REST API.

Build

Requires Go >= 1.21

make build

This will create a out/suseconnect binary.

Build in container

cd connect-ng
podman run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.16 make build

This will create a out/suseconnect binary on the host.

Testing

You can run all unit tests by running make test. If you then want to run unit tests for a specific package, you can simply run it as you would do for any Go project, for example: go test ./internal/collectors/.

For feature tests you first need to create an .env file in the root directory of the project with the following contents:

BETA_VALID_REGCODE="<regcode>"
BETA_NOT_ACTIVATED_REGCODE="<regcode>"
VALID_REGCODE="<regcode>"
EXPIRED_REGCODE="<regcode>"
NOT_ACTIVATED_REGCODE="<regcode>"

These values can be picked up from Glue's production environment. Once that is done, you can then simply run make feature-tests. This will run a all feature tests inside of a container by using the registration codes as provided by the .env file.