$ goss a file /etc/passwd $ goss a user nobody $ goss a --exclude-attr home --exclude-attr shell user nobody $ goss a --exclude-attr '* ' user nobody autoadd, aa - Auto add all matching resources to test suite Automatically all existing resources matching the provided argument. Will automatically add the following matching resources: • file - only if argument contains / • group • package • port • process - Also adding any ports it's listening to (if run as root) • service • user Will NOT automatically add: • addr • command - for safety • dns • http • interface • kernel-param • mount Example. Port: tcp:22: listening: true ip: - 0.0.0.0 tcp6:22: listening: true ip: - ':: ' service: sshd: enabled: true running: true user: sshd: exists: true uid: 74 gid: 74 groups: - sshd home: /var/empty/sshd shell: /sbin/nologin group: sshd: exists: true gid: 74 process: sshd: running: true render, r - Render gossfile after importing all referenced gossfiles This command allows you to keep your tests separated and render a single, valid, gossfile, by including them with the gossfile directive. Flags --debug This prints the rendered golang template prior to printing the parsed JSON/YAML gossfile. AutoAdd Plugin ¶. This plugin for Deluge 1.2+, adds multiple watch folder support. It supports settings per watch folder, including labels. This plugin comes included with Deluge 1.3+. Deluge 1.3.4 added magnet support for the watch folder. It supports a text file with a.magnet extension containing either. The latest Tweets from Auto Add-Ons (@AutoAdd_Ons): 'With any #Toyo or #Nitto #Tire purchase you can enter a draw to win a #Snowboard!| https. $ goss serve & $ curl # JSON endpoint $ goss serve --format json & $ curl localhost:8080/healthz validate, v - Validate the system validate runs the goss test suite on your server. Prints an rspec-like (by default) output of test results. Exits with status 0 on success, non-0 otherwise. Flags • --format, -f (output format) • documentation - Verbose test results • json - Detailed test result • json_oneline - Same as json, but oneliner • junit • nagios - Nagios/Sensu compatible output /w exit code 2 for failures. • nagios_verbose - Nagios output with verbose failure output. • rspecish (default) - Similar to rspec output • tap • silent - No output. Avoids exposing system information (e.g. When serving tests as a healthcheck endpoint). • --max-concurrent - Max number of tests to run concurrently • --no-color - Disable color • --color - Force enable color • --retry-timeout, -r - Retry on failure so long as elapsed + sleep time is less than this (default: 0) • --sleep, -s - Time to sleep between retries (default: 1s) Example. $ goss validate --format documentation File: /etc/hosts: exists: matches expectation: [true] DNS: localhost: resolvable: matches expectation: [true] [.] Total Duration: 0.002s Count: 10, Failed: 2, Skipped: 0 $ curl -s| goss validate.F.F [.] Total Duration: 0.002s Count: 6, Failed: 2, Skipped: 0 $ goss render| ssh remote-host 'goss -g - validate '. Total Duration: 0.002s Count: 6, Failed: 0, Skipped: 0 Important note about goss file format It is important to note that both YAML and JSON are formats that describe a nested data structure. WRONG way to write a goss file. # goss validate --format documentation File: /var/www/html: exists: matches expectation: [true] File: /var/www/html: filetype: matches expectation: [ 'directory '] Service: httpd: enabled: matches expectation: [true] Service: httpd: running: matches expectation: [true] Total Duration: 0.014s Count: 8, Failed: 0, Skipped: 0 As you can see, the first file check has not been run because the second file entry overwrites the previous one. You need to make sure all the entries of the same type are under the same declaration. This is the CORRECT way to write a goss file. User: nfsnobody: # required attributes exists: true # optional attributes uid: 65534 gid: 65534 groups: - nfsnobody home: /var/lib/nfs shell: /sbin/nologin Patterns For the attributes that use patterns (ex. File, command output), each pattern is checked against the attribute string, the type of patterns are: • 'string' - checks if any line contain string. • '!string' - inverse of above, checks that no line contains string • '!string' - escape sequence, check if any line contains '!string' • '/regex/' - verifies that line contains regex • '!/regex/' - inverse of above, checks that no line contains regex NOTE: Pattern attributes do not support NOTE: Regex support is based on golang's regex engine documented NOTE: You will need the double backslash ( ) escape for Regex special entities, for example s for blank spaces. If you buy an item worth $200 and get a free gift worth $20, they will charged you $180 ($200 with $20 AUTOADD discount) plus $20 for the free gift.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2019
Categories |