Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompose system/file.go for POSIX/Windows to allow building for Windows #298

Closed
wants to merge 1 commit into from

Conversation

eripa
Copy link

@eripa eripa commented Oct 25, 2017

Note: The minor changes here was done to allow for an internal specific use case, I'm just putting this here in case someone wants to pick it up. Personally I probably won't be working more on this.

This change enables goss to build for Windows. Initial step for #191.

Some caveats:

  • a test suite hasn't been created
    • cannot really use Docker for this, maybe Vagrant in the future?
    • this means that there are probably many bugs that I haven't seen
  • I've only tested it on Windows 8.1, using cygwin x86_64
    • which also means that there are probably many more issues on "pure" Windows
  • the Mode, Owner and Group function of system/file.go has been mocked with dummy data to build on Windows. Ideally these should be implemented in some platform native manner (that I'm not familiar with)

Example from my usecase:

vagrant@test_goss_windows ~
$ ./goss-windows.exe -g goss.yaml validate
.........

Total Duration: 0.033s
Count: 9, Failed: 0, Skipped: 0

vagrant@test_goss_windows ~
$ cat goss.yaml
file:
  C:\cygwin64\home\vagrant\some_file_that_doesnt_exist:
    exists: false
    contains: []
  C:\cygwin64\home\vagrant\consul.exe:
    exists: true
    mode: "0000"
    size: 43419136
    owner: Other Organization
    group: Other Organization
    filetype: file
    contains: []
command:
  /home/vagrant/disk_usage.exe -warning 50 -critical 60:
    exit-status: 0
    stdout: []
    stderr: []
    timeout: 10000
process:
  consul.exe:
    running: true

vagrant@test_goss_windows ~
$ uname -a
CYGWIN_NT-6.3 test_goss_windows 2.0.4(0.287/5/3) 2015-06-09 12:22 x86_64 Cygwin

@JackLeo
Copy link

JackLeo commented Mar 5, 2018

what about other parts of the tool? ports, services, etc?

@petemounce
Copy link
Collaborator

Packages (check via chocolatey)?

@petemounce petemounce mentioned this pull request Nov 8, 2018
4 tasks
@petemounce petemounce mentioned this pull request May 11, 2020
16 tasks
@aelsabbahy
Copy link
Member

closed by #585

@aelsabbahy aelsabbahy closed this Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants