-
-
Notifications
You must be signed in to change notification settings - Fork 5
Testing
Enno G edited this page May 20, 2024
·
2 revisions
The Golang-client tests can be executed using:
make test
Start a container that runs the Cobbler server on port 8081 on the host and execute the following commands:
touch /root/kernel /root/initrd /root/testfile
cobbler distro add --name=test --kernel=/root/kernel --initrd=/root/initrd
cobbler profile add --name=testprof --distro=test
cobbler system add --name=testsys --profile=testprof
cobbler repo add --name=testrepo
cobbler menu add --name=testmenu
cobbler image add --name=testimage
cobbler package add --name=testpackage
cobbler mgmtclass add --name=testmgmtclass
cobbler file add --name=testfile --path=/root/testfile --owner=root --group=root --mode="0644" --template=/etc/cobbler/dhcp.template
Default credentials are
cobbler
for both username and password.
To create new unit tests please use a combination of the following things:
./scripts/generate-fixture-xml.sh <fixture name>
-
curl -XPOST -d '<XML content>' http://localhost:25151/
(inside the container)
curl -XPOST -d '<methodCall><methodName>login</methodName><params><param><value><string>cobbler</string></value></param><param><value><string>cobbler</string></value></param></params></methodCall>' http://localhost:25151/