goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.57k stars 472 forks source link

FreeBSD Support #26

Closed rosstimson closed 4 years ago

rosstimson commented 8 years ago

Goss looks awesome. It would be great to get FreeBSD support.

aelsabbahy commented 8 years ago

I'll gladly accept pull requests on something like this, but don't currently have the free time to undertake this task.

jeremypruitt commented 7 years ago

I think I'll dive into this as we need to test FreeBSD hosts and I don't want to fragment our internal toolspace to accomplish that. I don't know what I am getting into as I haven't looked at the Goss code much. How tied to Linux is this? Did you try to write in a way that other OS could be added later or has it been mostly a Linux focused effort with no real concern about future OS?

I think my first goal is just to get the command resource and reporting features to work. That might end up being all I really need.

aelsabbahy commented 7 years ago

How tied to Linux is this?

Goss was definitely written with only linux in mind. Ports uses /proc, package managers and services have been implemented on a per-distro basis. It's been a very long time since I used freebsd, so I'm sure there's gotchas, just not sure how many.

Did you try to write in a way that other OS could be added later or has it been mostly a Linux focused effort with no real concern about future OS?

The later.

I'm very curious on your findings once you try to get this working. I would first see if it compiles for freebsd as-is, and try a goss file with just command resource defined. Most resources are lazy loaded from the system, so it might just work for that limited use case (if it compiles that is..).

jeremypruitt commented 7 years ago

I had to mess with the Makefile a bit, and I definitely don't have test coverage or anything like that, but basically the first build just worked as you suggested it might. It ran the command resource just fine, both in passing an failing conditions. This is FreeBSD 10.3-RELEASE-p11 amd64, btw. Clearly work to be done on the coverage and such, but so happy to see "it just works."

jeremypruitt commented 7 years ago

I just tried a number of the resources and this is what my initial efforts suggest goss can do on FreeBSD 10 in its current state.

Resources that can be validated on FreeBSD 10:

Resources that can be partially validated on FreeBSD 10:

Resources that do not validate at all on FreeBSD 10:

Also, as a bonus, I tried the goss “serve” command and that also worked. :)

aelsabbahy commented 7 years ago

Wow, that's a lot more than I expected, awesome!

Wonder if mount just needs to be bumped to a newer version from docker.

jeremypruitt commented 7 years ago

Ya, what you say about package/service makes sense

I was surprised about the owner/group part of the file resource. I can do a little more investigation on that. The file and mount resource issues make me wonder if it is just some kind of operator error :).

Also, the Makefile has steps like lint and test that shouldn't require much (any?) change, but what about steps like all?

Lastly, the integration tests are specific to Docker, which is fantastic, but I don't think that will work for FreeBSD testing. Any thoughts on this? Modify the current test.sh? Make a new test-freebsd.sh?

englishm-llnw commented 7 years ago

I've submitted sysutils/goss as a new FreeBSD port with a caveat regarding the limited functionality linking to this issue.

[ports]/head/sysutils/goss/pkg-message @r446527:

WARNING: goss is not yet fully functional on FreeBSD.
See https://github.com/aelsabbahy/goss/issues/26 for details.
freeseacher commented 6 years ago

does patches for freebsd are eligible?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.