1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

Merge pull request #91 from kellyjonbrazil/dev

Dev v1.14.0
This commit is contained in:
Kelly Brazil
2020-12-31 16:40:36 -08:00
committed by GitHub
47 changed files with 2222 additions and 13 deletions

View File

@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2

View File

@ -1,5 +1,14 @@
jc changelog
20201231 v1.14.0
- Add hashsum parser tested on linux, macos
- Add hash parser tested on linux, macos
- Add cksum parser tested on linux, macos
- Add wc parser tested on linux, macos
- Add printenv support under env parser
- Add vdir support under ls parser
- Add python 3.9 to github automation tests
20200805 v1.13.4
- Update crontab and crontab-u parsers to tighten up variable detection
- Update ping parser to tighten linux/bsd detection

View File

@ -175,6 +175,29 @@ blkid -o udev -ip /dev/sda2 | jc --blkid -p # or: jc -p blkid -o udev
}
]
```
### cksum
```bash
cksum * | jc --cksum -p # or: jc -p cksum *
```
```json
[
{
"filename": "__init__.py",
"checksum": 4294967295,
"blocks": 0
},
{
"filename": "airport.py",
"checksum": 2208551092,
"blocks": 3745
},
{
"filename": "airport_s.py",
"checksum": 1113817598,
"blocks": 4572
}
]
```
### crontab
```bash
cat /etc/crontab | jc --crontab -p # or: jc -p crontab -l
@ -843,6 +866,54 @@ cat /etc/gshadow | jc --gshadow -p
}
]
```
### hash
```bash
hash | jc --hash -p
```
```json
[
{
"hits": 2,
"command": "/bin/cat"
},
{
"hits": 1,
"command": "/bin/ls"
}
]
```
### hashsum
```bash
md5sum * | jc --hashsum -p # or: jc -p md5sum *
```
```json
[
{
"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm",
"hash": "65fc958c1add637ec23c4b137aecf3d3"
},
{
"filename": "digout",
"hash": "5b9312ee5aff080927753c63a347707d"
},
{
"filename": "dmidecode.out",
"hash": "716fd11c2ac00db109281f7110b8fb9d"
},
{
"filename": "file with spaces in the name",
"hash": "d41d8cd98f00b204e9800998ecf8427e"
},
{
"filename": "id-centos.out",
"hash": "4295be239a14ad77ef3253103de976d2"
},
{
"filename": "ifcfg.json",
"hash": "01fda0d9ba9a75618b072e64ff512b43"
}
]
```
### history
```bash
history | jc --history -p
@ -2469,6 +2540,32 @@ w | jc --w -p # or: jc -p w
}
]
```
### wc
```bash
wc * | jc --wc -p # or: jc -p wc *
```
```json
[
{
"filename": "airport-I.json",
"lines": 1,
"words": 30,
"characters": 307
},
{
"filename": "airport-I.out",
"lines": 15,
"words": 33,
"characters": 348
},
{
"filename": "airport-s.json",
"lines": 1,
"words": 202,
"characters": 2152
}
]
```
### who
```bash
who | jc --who -p # or: jc -p who

View File

@ -122,6 +122,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
- `--airport-s` enables the `airport -s` command parser (OSX)
- `--arp` enables the `arp` command parser
- `--blkid` enables the `blkid` command parser
- `--cksum` enables the `cksum` and `sum` command parser
- `--crontab` enables the `crontab` command and file parser
- `--crontab-u` enables the `crontab` file parser with user support
- `--csv` enables the `CSV` file parser
@ -130,12 +131,14 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
- `--dig` enables the `dig` command parser
- `--dmidecode` enables the `dmidecode` command parser
- `--du` enables the `du` command parser
- `--env` enables the `env` command parser
- `--env` enables the `env` and `printenv` command parser
- `--file` enables the `file` command parser
- `--free` enables the `free` command parser
- `--fstab` enables the `/etc/fstab` file parser
- `--group` enables the `/etc/group` file parser
- `--gshadow` enables the `/etc/gshadow` file parser
- `--hash` enables the `hash` command parser
- `--hashsum` enables the `hashsum` command parser (`md5sum`, `shasum`, etc.)
- `--history` enables the `history` command parser
- `--hosts` enables the `/etc/hosts` file parser
- `--id` enables the `id` command parser
@ -145,7 +148,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
- `--jobs` enables the `jobs` command parser
- `--kv` enables the `Key/Value` file parser
- `--last` enables the `last` and `lastb` command parser
- `--ls` enables the `ls` command parser
- `--ls` enables the `ls` and `vdir` command parser
- `--lsblk` enables the `lsblk` command parser
- `--lsmod` enables the `lsmod` command parser
- `--lsof` enables the `lsof` command parser
@ -172,6 +175,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
- `--uname` enables the `uname -a` command parser
- `--uptime` enables the `uptime` command parser
- `--w` enables the `w` command parser
- `--wc` enables the `wc` command parser
- `--who` enables the `who` command parser
- `--xml` enables the `XML` file parser
- `--yaml` enables the `YAML` file parser

View File

@ -9,6 +9,7 @@ pydocmd simple jc.parsers.airport+ > ../docs/parsers/airport.md
pydocmd simple jc.parsers.airport_s+ > ../docs/parsers/airport_s.md
pydocmd simple jc.parsers.arp+ > ../docs/parsers/arp.md
pydocmd simple jc.parsers.blkid+ > ../docs/parsers/blkid.md
pydocmd simple jc.parsers.cksum+ > ../docs/parsers/cksum.md
pydocmd simple jc.parsers.crontab+ > ../docs/parsers/crontab.md
pydocmd simple jc.parsers.crontab_u+ > ../docs/parsers/crontab_u.md
pydocmd simple jc.parsers.csv+ > ../docs/parsers/csv.md
@ -23,6 +24,8 @@ pydocmd simple jc.parsers.free+ > ../docs/parsers/free.md
pydocmd simple jc.parsers.fstab+ > ../docs/parsers/fstab.md
pydocmd simple jc.parsers.group+ > ../docs/parsers/group.md
pydocmd simple jc.parsers.gshadow+ > ../docs/parsers/gshadow.md
pydocmd simple jc.parsers.hash+ > ../docs/parsers/hash.md
pydocmd simple jc.parsers.hashsum+ > ../docs/parsers/hashsum.md
pydocmd simple jc.parsers.history+ > ../docs/parsers/history.md
pydocmd simple jc.parsers.hosts+ > ../docs/parsers/hosts.md
pydocmd simple jc.parsers.id+ > ../docs/parsers/id.md

95
docs/parsers/cksum.md Normal file
View File

@ -0,0 +1,95 @@
# jc.parsers.cksum
jc - JSON CLI output utility `cksum` command output parser
This parser works with the following checksum calculation utilities:
- `sum`
- `cksum`
Usage (cli):
$ cksum file.txt | jc --cksum
or
$ jc cksum file.txt
Usage (module):
import jc.parsers.cksum
result = jc.parsers.cksum.parse(cksum_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ cksum * | jc --cksum -p
[
{
"filename": "__init__.py",
"checksum": 4294967295,
"blocks": 0
},
{
"filename": "airport.py",
"checksum": 2208551092,
"blocks": 3745
},
{
"filename": "airport_s.py",
"checksum": 1113817598,
"blocks": 4572
},
...
]
## info
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"filename": string,
"checksum": integer,
"blocks": integer
}
]
## parse
```python
parse(data, raw=False, quiet=False)
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.

View File

@ -1,6 +1,6 @@
# jc.parsers.env
jc - JSON CLI output utility `env` command output parser
jc - JSON CLI output utility `env` and `printenv` command output parser
This parser will output a list of dictionaries each containing `name` and `value` keys. If you would like a simple dictionary output, then use the `-r` command-line option or the `raw=True` argument in the `parse()` function.

78
docs/parsers/hash.md Normal file
View File

@ -0,0 +1,78 @@
# jc.parsers.hash
jc - JSON CLI output utility `hash` command output parser
Usage (cli):
$ hash | jc --hash
Usage (module):
import jc.parsers.hash
result = jc.parsers.hash.parse(hash_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ hash | jc --hash -p
[
{
"hits": 2,
"command": "/bin/cat"
},
{
"hits": 1,
"command": "/bin/ls"
}
]
## info
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"command": string,
"hits": integer
}
]
## parse
```python
parse(data, raw=False, quiet=False)
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.

109
docs/parsers/hashsum.md Normal file
View File

@ -0,0 +1,109 @@
# jc.parsers.hashsum
jc - JSON CLI output utility `hash sum` command output parser
This parser works with the following hash calculation utilities:
- `md5`
- `md5sum`
- `shasum`
- `sha1sum`
- `sha224sum`
- `sha256sum`
- `sha384sum`
- `sha512sum`
Usage (cli):
$ md5sum file.txt | jc --hashsum
or
$ jc md5sum file.txt
Usage (module):
import jc.parsers.hashsum
result = jc.parsers.hashsum.parse(md5sum_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ md5sum * | jc --hashsum -p
[
{
"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm",
"hash": "65fc958c1add637ec23c4b137aecf3d3"
},
{
"filename": "digout",
"hash": "5b9312ee5aff080927753c63a347707d"
},
{
"filename": "dmidecode.out",
"hash": "716fd11c2ac00db109281f7110b8fb9d"
},
{
"filename": "file with spaces in the name",
"hash": "d41d8cd98f00b204e9800998ecf8427e"
},
{
"filename": "id-centos.out",
"hash": "4295be239a14ad77ef3253103de976d2"
},
{
"filename": "ifcfg.json",
"hash": "01fda0d9ba9a75618b072e64ff512b43"
},
...
]
## info
```python
info()
```
## process
```python
process(proc_data)
```
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"filename": string,
"hash": string,
}
]
## parse
```python
parse(data, raw=False, quiet=False)
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.

View File

@ -1,13 +1,13 @@
# jc.parsers.ls
jc - JSON CLI output utility `ls` command output parser
jc - JSON CLI output utility `ls` and `vdir` command output parser
Options supported:
- `lbaR`
- `--time-style=full-iso`
- `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. Alternatively, `vdir` can be used, which is the same as running `ls -lb`.
Usage (cli):

View File

@ -21,7 +21,7 @@ import jc.appdirs as appdirs
class info():
version = '1.13.4'
version = '1.14.0'
description = 'JSON CLI output utility'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -34,6 +34,7 @@ parsers = [
'airport-s',
'arp',
'blkid',
'cksum',
'crontab',
'crontab-u',
'csv',
@ -48,6 +49,8 @@ parsers = [
'fstab',
'group',
'gshadow',
'hash',
'hashsum',
'history',
'hosts',
'id',
@ -84,6 +87,7 @@ parsers = [
'uname',
'uptime',
'w',
'wc',
'who',
'xml',
'yaml'
@ -296,7 +300,7 @@ def helptext(message):
-d debug - show traceback (-dd for verbose traceback)
-m monochrome output
-p pretty print output
-q quiet - suppress warnings
-q quiet - suppress parser warnings
-r raw JSON output
Example:

128
jc/parsers/cksum.py Normal file
View File

@ -0,0 +1,128 @@
"""jc - JSON CLI output utility `cksum` command output parser
This parser works with the following checksum calculation utilities:
- `sum`
- `cksum`
Usage (cli):
$ cksum file.txt | jc --cksum
or
$ jc cksum file.txt
Usage (module):
import jc.parsers.cksum
result = jc.parsers.cksum.parse(cksum_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ cksum * | jc --cksum -p
[
{
"filename": "__init__.py",
"checksum": 4294967295,
"blocks": 0
},
{
"filename": "airport.py",
"checksum": 2208551092,
"blocks": 3745
},
{
"filename": "airport_s.py",
"checksum": 1113817598,
"blocks": 4572
},
...
]
"""
import jc.utils
class info():
version = '1.0'
description = 'cksum command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
details = 'Parses cksum and sum program output'
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['cksum', 'sum']
__version__ = info.version
def process(proc_data):
"""
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"filename": string,
"checksum": integer,
"blocks": integer
}
]
"""
for entry in proc_data:
int_list = ['checksum', 'blocks']
for key in int_list:
if key in entry:
try:
entry[key] = int(entry[key])
except (ValueError):
entry[key] = None
return proc_data
def parse(data, raw=False, quiet=False):
"""
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.
"""
if not quiet:
jc.utils.compatibility(__name__, info.compatible)
raw_output = []
if jc.utils.has_data(data):
for line in filter(None, data.splitlines()):
item = {
'filename': line.split(maxsplit=2)[2],
'checksum': line.split(maxsplit=2)[0],
'blocks': line.split(maxsplit=2)[1]
}
raw_output.append(item)
if raw:
return raw_output
else:
return process(raw_output)

View File

@ -1,4 +1,4 @@
"""jc - JSON CLI output utility `env` command output parser
"""jc - JSON CLI output utility `env` and `printenv` command output parser
This parser will output a list of dictionaries each containing `name` and `value` keys. If you would like a simple dictionary output, then use the `-r` command-line option or the `raw=True` argument in the `parse()` function.
@ -70,7 +70,7 @@ class info():
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['env']
magic_commands = ['env', 'printenv']
__version__ = info.version

108
jc/parsers/hash.py Normal file
View File

@ -0,0 +1,108 @@
"""jc - JSON CLI output utility `hash` command output parser
Usage (cli):
$ hash | jc --hash
Usage (module):
import jc.parsers.hash
result = jc.parsers.hash.parse(hash_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ hash | jc --hash -p
[
{
"hits": 2,
"command": "/bin/cat"
},
{
"hits": 1,
"command": "/bin/ls"
}
]
"""
import jc.utils
import jc.parsers.universal
class info():
version = '1.0'
description = 'hash command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
__version__ = info.version
def process(proc_data):
"""
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"command": string,
"hits": integer
}
]
"""
for entry in proc_data:
# change to int
int_list = ['hits']
for key in int_list:
if key in entry:
try:
key_int = int(entry[key])
entry[key] = key_int
except (ValueError):
entry[key] = None
return proc_data
def parse(data, raw=False, quiet=False):
"""
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.
"""
if not quiet:
jc.utils.compatibility(__name__, info.compatible)
cleandata = data.splitlines()
raw_output = []
if jc.utils.has_data(data):
cleandata[0] = cleandata[0].lower()
raw_output = jc.parsers.universal.simple_table_parse(cleandata)
if raw:
return raw_output
else:
return process(raw_output)

145
jc/parsers/hashsum.py Normal file
View File

@ -0,0 +1,145 @@
"""jc - JSON CLI output utility `hash sum` command output parser
This parser works with the following hash calculation utilities:
- `md5`
- `md5sum`
- `shasum`
- `sha1sum`
- `sha224sum`
- `sha256sum`
- `sha384sum`
- `sha512sum`
Usage (cli):
$ md5sum file.txt | jc --hashsum
or
$ jc md5sum file.txt
Usage (module):
import jc.parsers.hashsum
result = jc.parsers.hashsum.parse(md5sum_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ md5sum * | jc --hashsum -p
[
{
"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm",
"hash": "65fc958c1add637ec23c4b137aecf3d3"
},
{
"filename": "digout",
"hash": "5b9312ee5aff080927753c63a347707d"
},
{
"filename": "dmidecode.out",
"hash": "716fd11c2ac00db109281f7110b8fb9d"
},
{
"filename": "file with spaces in the name",
"hash": "d41d8cd98f00b204e9800998ecf8427e"
},
{
"filename": "id-centos.out",
"hash": "4295be239a14ad77ef3253103de976d2"
},
{
"filename": "ifcfg.json",
"hash": "01fda0d9ba9a75618b072e64ff512b43"
},
...
]
"""
import jc.utils
class info():
version = '1.0'
description = 'hashsum command parser (md5sum, shasum, etc.)'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
details = 'Parses MD5 and SHA hash program output'
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['md5sum', 'md5', 'shasum', 'sha1sum', 'sha224sum', 'sha256sum', 'sha384sum', 'sha512sum']
__version__ = info.version
def process(proc_data):
"""
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"filename": string,
"hash": string,
}
]
"""
# no further processing for this parser
return proc_data
def parse(data, raw=False, quiet=False):
"""
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.
"""
if not quiet:
jc.utils.compatibility(__name__, info.compatible)
raw_output = []
if jc.utils.has_data(data):
for line in filter(None, data.splitlines()):
# check for legacy md5 command output
if line.startswith('MD5 ('):
file_hash = line.split('=', maxsplit=1)[1].strip()
file_name = line.split('=', maxsplit=1)[0].strip()
file_name = file_name[5:]
file_name = file_name[:-1]
# standard md5sum and shasum command output
else:
file_hash = line.split(maxsplit=1)[0]
file_name = line.split(maxsplit=1)[1]
item = {
'filename': file_name,
'hash': file_hash
}
raw_output.append(item)
if raw:
return raw_output
else:
return process(raw_output)

View File

@ -1,11 +1,11 @@
"""jc - JSON CLI output utility `ls` command output parser
"""jc - JSON CLI output utility `ls` and `vdir` command output parser
Options supported:
- `lbaR`
- `--time-style=full-iso`
- `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. Since `ls` does not encode newlines in filenames when outputting to a pipe it will cause `jc` to see multiple files instead of a single file if `-l` or `-b` is not used. Alternatively, `vdir` can be used, which is the same as running `ls -lb`.
Usage (cli):
@ -160,7 +160,7 @@ class info():
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['ls']
magic_commands = ['ls', 'vdir']
__version__ = info.version

129
jc/parsers/wc.py Normal file
View File

@ -0,0 +1,129 @@
"""jc - JSON CLI output utility `wc` command output parser
Usage (cli):
$ wc file.txt | jc --wc
or
$ jc wc file.txt
Usage (module):
import jc.parsers.wc
result = jc.parsers.wc.parse(wc_command_output)
Compatibility:
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
Examples:
$ wc * | jc --wc -p
[
{
"filename": "airport-I.json",
"lines": 1,
"words": 30,
"characters": 307
},
{
"filename": "airport-I.out",
"lines": 15,
"words": 33,
"characters": 348
},
{
"filename": "airport-s.json",
"lines": 1,
"words": 202,
"characters": 2152
},
...
]
"""
import jc.utils
class info():
version = '1.0'
description = 'wc command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['wc']
__version__ = info.version
def process(proc_data):
"""
Final processing to conform to the schema.
Parameters:
proc_data: (dictionary) raw structured data to process
Returns:
List of dictionaries. Structured data with the following schema:
[
{
"filename": string,
"lines": integer,
"words": integer,
"characters": integer
}
]
"""
for entry in proc_data:
int_list = ['lines', 'words', 'characters']
for key in int_list:
if key in entry:
try:
entry[key] = int(entry[key])
except (ValueError):
entry[key] = None
return proc_data
def parse(data, raw=False, quiet=False):
"""
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
List of dictionaries. Raw or processed structured data.
"""
if not quiet:
jc.utils.compatibility(__name__, info.compatible)
raw_output = []
if jc.utils.has_data(data):
for line in filter(None, data.splitlines()):
split_line = line.split(maxsplit=3)
item = {
'filename': split_line[3] if len(split_line) == 4 else None,
'lines': split_line[0],
'words': split_line[1],
'characters': split_line[2]
}
raw_output.append(item)
if raw:
return raw_output
else:
return process(raw_output)

1
tests/fixtures/centos-7.7/cksum.json vendored Normal file
View File

@ -0,0 +1 @@
[{"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm", "checksum": 3194693727, "blocks": 24150660}, {"filename": "digout", "checksum": 1851496064, "blocks": 1196}, {"filename": "dmidecode.out", "checksum": 3221261569, "blocks": 277288}, {"filename": "ethtool.out", "checksum": 4227574970, "blocks": 748}, {"filename": "file with spaces in the name", "checksum": 4294967295, "blocks": 0}, {"filename": "id-centos.out", "checksum": 22642479, "blocks": 129}, {"filename": "ifcfg.json", "checksum": 2870739759, "blocks": 1600}, {"filename": "ifconfig.out", "checksum": 2514469297, "blocks": 1278}, {"filename": "jc", "checksum": 1519020121, "blocks": 58764280}, {"filename": "jc-1.10.5-linux.sha256", "checksum": 1419642770, "blocks": 69}, {"filename": "jc-1.10.5-linux.tar.gz", "checksum": 4103750556, "blocks": 21978413}, {"filename": "jc-1.10.5.rpm", "checksum": 901847831, "blocks": 21716708}, {"filename": "jc-1.11.1-linux.sha256", "checksum": 2941909126, "blocks": 69}, {"filename": "jc-1.11.1-linux.tar.gz", "checksum": 2257585750, "blocks": 20226936}, {"filename": "jc-1.11.1.sha256", "checksum": 1000678195, "blocks": 69}, {"filename": "jc-1.11.1.tar.gz", "checksum": 2080460101, "blocks": 20225785}, {"filename": "jc-1.11.2-linux.sha256", "checksum": 1504349309, "blocks": 69}, {"filename": "jc-1.11.2-linux.tar.gz", "checksum": 1847458112, "blocks": 20231427}, {"filename": "jc-1.11.8-linux.sha256", "checksum": 1107685588, "blocks": 69}, {"filename": "jc-1.11.8-linux.tar.gz", "checksum": 3146155218, "blocks": 20241790}, {"filename": "jc-1.13.1-linux.sha256", "checksum": 2813075513, "blocks": 69}, {"filename": "jc-1.13.1-linux.tar.gz", "checksum": 1234240055, "blocks": 20268540}, {"filename": "jc-1.13.2-linux.sha256", "checksum": 806999822, "blocks": 69}, {"filename": "jc-1.13.2-linux.tar.gz", "checksum": 3132593132, "blocks": 20263630}, {"filename": "jc-1.13.4-linux.sha256", "checksum": 4099431772, "blocks": 69}, {"filename": "jc-1.13.4-linux.tar.gz", "checksum": 585256943, "blocks": 20264188}, {"filename": "jello-1.2.8-linux.sha256", "checksum": 3376281076, "blocks": 72}, {"filename": "jello-1.2.8-linux.tar.gz", "checksum": 3017693313, "blocks": 19899656}, {"filename": "jello-1.2.9-linux.sha256", "checksum": 2752469143, "blocks": 72}, {"filename": "jello-1.2.9-linux.tar.gz", "checksum": 464841230, "blocks": 19901109}, {"filename": "journaljson", "checksum": 220197660, "blocks": 6014042}, {"filename": "jp", "checksum": 1892840001, "blocks": 3426382}, {"filename": "jp_1.1.12_linux_x86_64.zip", "checksum": 1931622609, "blocks": 1174326}, {"filename": "jq_twitter.json", "checksum": 48933934, "blocks": 738160}, {"filename": "jtbl-1.1.6-linux.sha256", "checksum": 3187469112, "blocks": 71}, {"filename": "jtbl-1.1.6-linux.tar.gz", "checksum": 3178056589, "blocks": 18224334}, {"filename": "kbls.out", "checksum": 20037015, "blocks": 4152}, {"filename": "lastb.out", "checksum": 578204035, "blocks": 269}, {"filename": "lsblk-cols", "checksum": 977417403, "blocks": 1559}, {"filename": "ping-ip-O-D.out", "checksum": 1309174893, "blocks": 1751}, {"filename": "ping-ip-O.out", "checksum": 3674431351, "blocks": 1351}, {"filename": "psfile.txt", "checksum": 38743147, "blocks": 7786}, {"filename": "resizeterm.sh", "checksum": 1313583846, "blocks": 355}, {"filename": "route-6-n.out", "checksum": 1511061346, "blocks": 1802}, {"filename": "route-6.out", "checksum": 1574928177, "blocks": 1814}, {"filename": "routeout", "checksum": 1277932868, "blocks": 690}, {"filename": "sha384sum.out", "checksum": 3868747289, "blocks": 6434}, {"filename": "shafile.txt", "checksum": 1039827125, "blocks": 2850}, {"filename": "ss-aeep.out", "checksum": 2355562581, "blocks": 26724}, {"filename": "ssout", "checksum": 1754458832, "blocks": 20190}, {"filename": "sum.out", "checksum": 4143011907, "blocks": 1668}, {"filename": "systemctl.out", "checksum": 3736720956, "blocks": 38746}, {"filename": "top.out", "checksum": 2738959094, "blocks": 5314}, {"filename": "tracepath6.out", "checksum": 3198330928, "blocks": 252}, {"filename": "tracepath-cnn.out", "checksum": 1367648069, "blocks": 939}, {"filename": "tr.out", "checksum": 2683788995, "blocks": 1137}, {"filename": "who-aH.out", "checksum": 3295769480, "blocks": 355}, {"filename": "who.out", "checksum": 969319749, "blocks": 93}, {"filename": "whotext", "checksum": 543168390, "blocks": 281}]

59
tests/fixtures/centos-7.7/cksum.out vendored Normal file
View File

@ -0,0 +1,59 @@
3194693727 24150660 devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
1851496064 1196 digout
3221261569 277288 dmidecode.out
4227574970 748 ethtool.out
4294967295 0 file with spaces in the name
22642479 129 id-centos.out
2870739759 1600 ifcfg.json
2514469297 1278 ifconfig.out
1519020121 58764280 jc
1419642770 69 jc-1.10.5-linux.sha256
4103750556 21978413 jc-1.10.5-linux.tar.gz
901847831 21716708 jc-1.10.5.rpm
2941909126 69 jc-1.11.1-linux.sha256
2257585750 20226936 jc-1.11.1-linux.tar.gz
1000678195 69 jc-1.11.1.sha256
2080460101 20225785 jc-1.11.1.tar.gz
1504349309 69 jc-1.11.2-linux.sha256
1847458112 20231427 jc-1.11.2-linux.tar.gz
1107685588 69 jc-1.11.8-linux.sha256
3146155218 20241790 jc-1.11.8-linux.tar.gz
2813075513 69 jc-1.13.1-linux.sha256
1234240055 20268540 jc-1.13.1-linux.tar.gz
806999822 69 jc-1.13.2-linux.sha256
3132593132 20263630 jc-1.13.2-linux.tar.gz
4099431772 69 jc-1.13.4-linux.sha256
585256943 20264188 jc-1.13.4-linux.tar.gz
3376281076 72 jello-1.2.8-linux.sha256
3017693313 19899656 jello-1.2.8-linux.tar.gz
2752469143 72 jello-1.2.9-linux.sha256
464841230 19901109 jello-1.2.9-linux.tar.gz
220197660 6014042 journaljson
1892840001 3426382 jp
1931622609 1174326 jp_1.1.12_linux_x86_64.zip
48933934 738160 jq_twitter.json
3187469112 71 jtbl-1.1.6-linux.sha256
3178056589 18224334 jtbl-1.1.6-linux.tar.gz
20037015 4152 kbls.out
578204035 269 lastb.out
977417403 1559 lsblk-cols
1309174893 1751 ping-ip-O-D.out
3674431351 1351 ping-ip-O.out
38743147 7786 psfile.txt
1313583846 355 resizeterm.sh
1511061346 1802 route-6-n.out
1574928177 1814 route-6.out
1277932868 690 routeout
3868747289 6434 sha384sum.out
1039827125 2850 shafile.txt
2355562581 26724 ss-aeep.out
1754458832 20190 ssout
4143011907 1668 sum.out
3736720956 38746 systemctl.out
2738959094 5314 top.out
3198330928 252 tracepath6.out
1367648069 939 tracepath-cnn.out
2683788995 1137 tr.out
3295769480 355 who-aH.out
969319749 93 who.out
543168390 281 whotext

1
tests/fixtures/centos-7.7/hash.json vendored Normal file
View File

@ -0,0 +1 @@
[{"hits": 3, "command": "/usr/bin/sum"}, {"hits": 2, "command": "/usr/bin/cat"}, {"hits": 2, "command": "/usr/bin/cksum"}]

4
tests/fixtures/centos-7.7/hash.out vendored Normal file
View File

@ -0,0 +1,4 @@
hits command
3 /usr/bin/sum
2 /usr/bin/cat
2 /usr/bin/cksum

1
tests/fixtures/centos-7.7/md5sum.json vendored Normal file
View File

@ -0,0 +1 @@
[{"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm", "hash": "65fc958c1add637ec23c4b137aecf3d3"}, {"filename": "digout", "hash": "5b9312ee5aff080927753c63a347707d"}, {"filename": "dmidecode.out", "hash": "716fd11c2ac00db109281f7110b8fb9d"}, {"filename": "file with spaces in the name", "hash": "d41d8cd98f00b204e9800998ecf8427e"}, {"filename": "id-centos.out", "hash": "4295be239a14ad77ef3253103de976d2"}, {"filename": "ifcfg.json", "hash": "01fda0d9ba9a75618b072e64ff512b43"}, {"filename": "ifconfig.out", "hash": "e3bff970404527b132dca58031c7286f"}, {"filename": "jc", "hash": "b8b604dc8213d9a6515f2c04bdccfb3b"}, {"filename": "jc-1.10.5-linux.sha256", "hash": "14236ca18714d2b6282758e9b7b46000"}, {"filename": "jc-1.10.5-linux.tar.gz", "hash": "a13b2843c1e8029a98503bc07613862c"}, {"filename": "jc-1.10.5.rpm", "hash": "d0e05de2651857155f8673dc113272ae"}, {"filename": "jc-1.11.1-linux.sha256", "hash": "53e4b33fa99c53c28972db666de9b7b3"}, {"filename": "jc-1.11.1-linux.tar.gz", "hash": "ea4145789224b142361016412cd613b7"}, {"filename": "jc-1.11.1.sha256", "hash": "c6c5fd21ef572dd6d2629c44ad566425"}, {"filename": "jc-1.11.1.tar.gz", "hash": "d838680555f84aff7f286dd440b2490b"}, {"filename": "jc-1.11.2-linux.sha256", "hash": "e7d5c22044848539c2cbd9f5b562de9a"}, {"filename": "jc-1.11.2-linux.tar.gz", "hash": "e6d842ead8cfc9a58df9dce7814ee657"}, {"filename": "jc-1.11.8-linux.sha256", "hash": "24a5005717ab949fd7608aaa77bfeade"}, {"filename": "jc-1.11.8-linux.tar.gz", "hash": "6a84320c7551c51051a748c873d91194"}, {"filename": "jc-1.13.1-linux.sha256", "hash": "54431e32a1ffa7a90f520a6d8ae966fc"}, {"filename": "jc-1.13.1-linux.tar.gz", "hash": "c7a084d9de6bf1193ea0601a2239fc2b"}, {"filename": "jc-1.13.2-linux.sha256", "hash": "1adf518be9a071131ab105155fee176a"}, {"filename": "jc-1.13.2-linux.tar.gz", "hash": "4d8dd74578bc7817de0834e2349c4466"}, {"filename": "jc-1.13.4-linux.sha256", "hash": "3b63bfaff06d9c825aa0a1e0d062a10e"}, {"filename": "jc-1.13.4-linux.tar.gz", "hash": "a5d7feae690e2c3d6bc4acef4205b308"}, {"filename": "jello-1.2.8-linux.sha256", "hash": "90d4fe29d8860adb46f14c99bd27306f"}, {"filename": "jello-1.2.8-linux.tar.gz", "hash": "ea4eadde3abe740d23feb38225e8fe46"}, {"filename": "jello-1.2.9-linux.sha256", "hash": "c690e9126ed296535046e68bfa02de94"}, {"filename": "jello-1.2.9-linux.tar.gz", "hash": "28d6899def6cb63e69d6bb8f53365ecd"}, {"filename": "journaljson", "hash": "5fed1973e223d1f1e45fccec089cb285"}, {"filename": "jp", "hash": "e49f9acb33479f59b7be1f94e8daa3db"}, {"filename": "jp_1.1.12_linux_x86_64.zip", "hash": "ef49750c3f69ae22b8c456e38e4ea39c"}, {"filename": "jq_twitter.json", "hash": "b86c4c8487e3c0bb656d068886c413b7"}, {"filename": "jtbl-1.1.6-linux.sha256", "hash": "d1427e00cbe4e0d1b5b239993ca474b5"}, {"filename": "jtbl-1.1.6-linux.tar.gz", "hash": "87d36c9c35c5ce23f691634d3faad06e"}, {"filename": "kbls.out", "hash": "b3d0c62d77c4f2861cb1dd7464faaa24"}, {"filename": "lastb.out", "hash": "7907a2a62c9f3e1a558ad24ff93fac2c"}, {"filename": "lsblk-cols", "hash": "d9920641b832e86c52e1ef380f777f63"}, {"filename": "ping-ip-O-D.out", "hash": "9ab7407b788aa94b95fe49dbc131b2cb"}, {"filename": "ping-ip-O.out", "hash": "969a0243a76a3bf407e3a24082af8068"}, {"filename": "psfile.txt", "hash": "e1e61d18b3e96359940a22c10f30ad34"}, {"filename": "resizeterm.sh", "hash": "9aa6b53e55b3134219c061441d5c0b3f"}, {"filename": "route-6-n.out", "hash": "e1e1084c23889b46a055d0f8101c0947"}, {"filename": "route-6.out", "hash": "4e75a36fcbf5b1f74c42849c641eb7d4"}, {"filename": "routeout", "hash": "fbb00b1c066988b8d4ce285309fc2a55"}, {"filename": "shafile.txt", "hash": "a54b97e7ffb498130a5807c492fd06bd"}, {"filename": "ss-aeep.out", "hash": "4aa7a33ccd4d863f2dc34570bc9a4761"}, {"filename": "ssout", "hash": "9e61faf4a86f484745e9361a6c33249b"}, {"filename": "systemctl.out", "hash": "eea802ae7bcbb6b63678b5ec68df6212"}, {"filename": "top.out", "hash": "8fc90c98a0b0455ba359199e98a3951a"}, {"filename": "tracepath6.out", "hash": "cdbfa0898a3c089a24ecdab4b62e0241"}, {"filename": "tracepath-cnn.out", "hash": "c5a2a5d40fcf6617d3ca1fae4766f70c"}, {"filename": "tr.out", "hash": "dedcbcfcf486d1620c7495c7c9700a02"}, {"filename": "who-aH.out", "hash": "6a90a054f9df3abdfe936c03e53b71d4"}, {"filename": "who.out", "hash": "d5c25156c301c14125aaa5d1e8f5adbb"}, {"filename": "whotext", "hash": "cbe28a0722637d2ea2c07378eba2206e"}]

56
tests/fixtures/centos-7.7/md5sum.out vendored Normal file
View File

@ -0,0 +1,56 @@
65fc958c1add637ec23c4b137aecf3d3 devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
5b9312ee5aff080927753c63a347707d digout
716fd11c2ac00db109281f7110b8fb9d dmidecode.out
d41d8cd98f00b204e9800998ecf8427e file with spaces in the name
4295be239a14ad77ef3253103de976d2 id-centos.out
01fda0d9ba9a75618b072e64ff512b43 ifcfg.json
e3bff970404527b132dca58031c7286f ifconfig.out
b8b604dc8213d9a6515f2c04bdccfb3b jc
14236ca18714d2b6282758e9b7b46000 jc-1.10.5-linux.sha256
a13b2843c1e8029a98503bc07613862c jc-1.10.5-linux.tar.gz
d0e05de2651857155f8673dc113272ae jc-1.10.5.rpm
53e4b33fa99c53c28972db666de9b7b3 jc-1.11.1-linux.sha256
ea4145789224b142361016412cd613b7 jc-1.11.1-linux.tar.gz
c6c5fd21ef572dd6d2629c44ad566425 jc-1.11.1.sha256
d838680555f84aff7f286dd440b2490b jc-1.11.1.tar.gz
e7d5c22044848539c2cbd9f5b562de9a jc-1.11.2-linux.sha256
e6d842ead8cfc9a58df9dce7814ee657 jc-1.11.2-linux.tar.gz
24a5005717ab949fd7608aaa77bfeade jc-1.11.8-linux.sha256
6a84320c7551c51051a748c873d91194 jc-1.11.8-linux.tar.gz
54431e32a1ffa7a90f520a6d8ae966fc jc-1.13.1-linux.sha256
c7a084d9de6bf1193ea0601a2239fc2b jc-1.13.1-linux.tar.gz
1adf518be9a071131ab105155fee176a jc-1.13.2-linux.sha256
4d8dd74578bc7817de0834e2349c4466 jc-1.13.2-linux.tar.gz
3b63bfaff06d9c825aa0a1e0d062a10e jc-1.13.4-linux.sha256
a5d7feae690e2c3d6bc4acef4205b308 jc-1.13.4-linux.tar.gz
90d4fe29d8860adb46f14c99bd27306f jello-1.2.8-linux.sha256
ea4eadde3abe740d23feb38225e8fe46 jello-1.2.8-linux.tar.gz
c690e9126ed296535046e68bfa02de94 jello-1.2.9-linux.sha256
28d6899def6cb63e69d6bb8f53365ecd jello-1.2.9-linux.tar.gz
5fed1973e223d1f1e45fccec089cb285 journaljson
e49f9acb33479f59b7be1f94e8daa3db jp
ef49750c3f69ae22b8c456e38e4ea39c jp_1.1.12_linux_x86_64.zip
b86c4c8487e3c0bb656d068886c413b7 jq_twitter.json
d1427e00cbe4e0d1b5b239993ca474b5 jtbl-1.1.6-linux.sha256
87d36c9c35c5ce23f691634d3faad06e jtbl-1.1.6-linux.tar.gz
b3d0c62d77c4f2861cb1dd7464faaa24 kbls.out
7907a2a62c9f3e1a558ad24ff93fac2c lastb.out
d9920641b832e86c52e1ef380f777f63 lsblk-cols
9ab7407b788aa94b95fe49dbc131b2cb ping-ip-O-D.out
969a0243a76a3bf407e3a24082af8068 ping-ip-O.out
e1e61d18b3e96359940a22c10f30ad34 psfile.txt
9aa6b53e55b3134219c061441d5c0b3f resizeterm.sh
e1e1084c23889b46a055d0f8101c0947 route-6-n.out
4e75a36fcbf5b1f74c42849c641eb7d4 route-6.out
fbb00b1c066988b8d4ce285309fc2a55 routeout
a54b97e7ffb498130a5807c492fd06bd shafile.txt
4aa7a33ccd4d863f2dc34570bc9a4761 ss-aeep.out
9e61faf4a86f484745e9361a6c33249b ssout
eea802ae7bcbb6b63678b5ec68df6212 systemctl.out
8fc90c98a0b0455ba359199e98a3951a top.out
cdbfa0898a3c089a24ecdab4b62e0241 tracepath6.out
c5a2a5d40fcf6617d3ca1fae4766f70c tracepath-cnn.out
dedcbcfcf486d1620c7495c7c9700a02 tr.out
6a90a054f9df3abdfe936c03e53b71d4 who-aH.out
d5c25156c301c14125aaa5d1e8f5adbb who.out
cbe28a0722637d2ea2c07378eba2206e whotext

File diff suppressed because one or more lines are too long

55
tests/fixtures/centos-7.7/sha256sum.out vendored Normal file
View File

@ -0,0 +1,55 @@
1955249927f4d64b17188766c346ecb8db77010efd9e44f875b41debe8255b44 devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
ce1b491e2ef2a20964b52dc852b411b0fdeaae8f5b5d30efed1f44657c01777b digout
59f22892a2c115a41e1f0b26c64150ea8d3b00f1ea25f1909a0b67e5f6b1dcb6 dmidecode.out
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 file with spaces in the name
0757f114c4383437d1b013ebf335360ff24475253ea54d2708a0f28ceddbc7a8 id-centos.out
7afa0e7d4404ff0f45e51176430261eab140ed1940743f298323646a27ce3005 ifcfg.json
a06f5e6c47eabfb1b7e32cee847d120d25f8c7393345546001405b792f762173 ifconfig.out
2a2faee2eea4ce0a6d10069cd95932bbc5ae4b70c6dc913502edbfe39a3f759f jc
1545a9426548e5fd74f32ad7db964c513b933e2bf6608abc08ba562908fa5c19 jc-1.10.5-linux.sha256
89d4d3b5f978fdf8ad379501c011723486ae09923d778d68ae381b74b3eb0255 jc-1.10.5-linux.tar.gz
e46c5a7921629157c42416d2f47ea30ab815be016a7502f6e4b0f56788c15ba2 jc-1.10.5.rpm
18587497e5b8155d4fb063a0712e968f49770f9f2c3166e5ac6dacbaf24dbfc6 jc-1.11.1-linux.sha256
70c0c66b9f687eb8b214984238578fba1424f8e5dbf90fe6eab4a5e0db55c40d jc-1.11.1-linux.tar.gz
4f0069a8501a7f9b6e52187ce1e5ec3606ab0be94eeec887a813cae29c3d4c44 jc-1.11.1.sha256
4847c84a14e76365b81278120261450565344d499b20472f55bb501a3da87350 jc-1.11.1.tar.gz
11c00413590b4f84d6b816d00e9de146f3033de1a800584b50679bc819e6a727 jc-1.11.2-linux.sha256
bc4a507c807972bff6c736c6932875556d0534ae4ff95530120e75c0d61ddc85 jc-1.11.2-linux.tar.gz
649b292cec88e0792a81113288782a536a7a068652675b971bd114ddd110efa2 jc-1.11.8-linux.sha256
11b9b8d775d2c9c912f26c851f4e1d8b7ed1274148856e644713f9c48f9a3d04 jc-1.11.8-linux.tar.gz
47f56c6b164cd7cc5875c6a8f29d5fe34ebb6288352a8c6526621563803e2dcb jc-1.13.1-linux.sha256
6bd22a6cd7fd25d002f167fa9e1af46abc581ac3da8aacbcfec31a403fd2021d jc-1.13.1-linux.tar.gz
b170212b843b6de279937f9601345f955f28ccf41fcfd94d802fc3cc7611c358 jc-1.13.2-linux.sha256
3e1a4bb0af20f90e040b68eab2a8fe84fa4818099eae5c834a95a5042019007d jc-1.13.2-linux.tar.gz
9c1168b67782627617f806c4e7282a2a9fe133cbbf592baa0ec96dec46e6f27e jc-1.13.4-linux.sha256
e5419e799b71127636f7c630396c531c358c5f94660a73b3bf03b51ee0982b83 jc-1.13.4-linux.tar.gz
3c2084cebfeb26aa237c893c1543371a0c29aa356114d05c091b5c2e9b188054 jello-1.2.8-linux.sha256
65afd200472dcf20d8f629f2f20ee2e2bddaabd60cebb751e7cc9ed814f458ce jello-1.2.8-linux.tar.gz
9aac7a7bbdcb5f64b75cc2a5f17d206510ce064d93b58dee13fa5236ea5ad28e jello-1.2.9-linux.sha256
a95e7d67721430e00e6a342e6aac9fb6343069d6197b0b3c057262e6bf53c4ca jello-1.2.9-linux.tar.gz
fc49676c9cd6282009389f91758ec50bc1ee2110ccd8ec5aa70bb27c2d6a6532 journaljson
cd381415eb8283c41aba775bf18b8557c969a1502024f366d39fd89f72671f95 jp
4edf3eb53ed6e039cb07727cd14c4a6f4d6707fbd04d5cb0e3618fa3b791b329 jp_1.1.12_linux_x86_64.zip
3205543a4e6a28b40c86c4bf8509fb767242883e3ed0713a619d5432e308ae16 jq_twitter.json
dcc894867b1db84699df8a79d6a1d414151d444cec7feed42e8e136bf844d08c jtbl-1.1.6-linux.sha256
d18d1bb545c534e4cabc9754881fec08a1a3adb96f3c4578517ad191bd49604b jtbl-1.1.6-linux.tar.gz
54bd2863b30de34da9733e7a46edd2485c32ecd74cf2ed7a4af1e59902dd99bd kbls.out
cff67b694bd444870dbc499267a455a0a5fd4809e283a644126579930aee614a lastb.out
46cf694a46f04293b3e5faf0dd1fa00d53e9f04a590136aa0df96611d9af3bdb lsblk-cols
3d27980f6cff1b2ebea4c7e27f00d9d4239022ffc976e146eada539867e89a66 ping-ip-O-D.out
3cbed448e88079c7a4cbf801146e877c844b68ecd35b5181bf85f5efef62864b ping-ip-O.out
98cd30e314cce9f9fe96f6fd4935358ef336da46e001781ab4f09970c02cc8f9 psfile.txt
dc0224031da7b5cecf2a2f17f2d3478e14de1ea14a12fb074972f5fa3ecac751 resizeterm.sh
c60aecaa7f75e7675d1e9fb6dac4ff12d111bdab81e1cc92e3f8f5ba257bf31e route-6-n.out
d9aee0bbfab4b35e2c09aab45f9859ba74cd4384f30a3a728696d29e6b8c6be0 route-6.out
4e72611aea8d9a1a65acbcc516e7ac255fc7d94a4f2915b0746193ccb00d7fd9 routeout
9793d970259c55437667bae568d913a7e4a2c0894ac758214e8478847405dc06 ss-aeep.out
5a3b23c271fe17c4fb34bb96c20233d1eb64e1a3c5f07d8818cd86cc53f97a54 ssout
5ebf02f674876f72fe2f4282fa81af22f4b799e1999122bb18ed4d03c8f6eb60 systemctl.out
a66c17407fe22279bf76d35080ada3918cd96c65f7bc4160ce4267c13a9743d2 top.out
45cfd9c83a151e21efa57b7d7b08691810b6ed4cfd55cb91671a7a6c1cd02487 tracepath6.out
8e9fdb6774a59eed03a81430bbbe4ea44e3df544e92265d774112090b00f051d tracepath-cnn.out
891c97e4c4f32263c1c99c52f50c6d4e8e3fbab94bdf2d6f71f7a44fa4e00239 tr.out
a8494cbbc24713274d96c522c40b44d8528be25e8beb35096f34efdf95679771 who-aH.out
1956b4a9ebf50db3734976d4f2cab0fb929aca2a81043bf37f2b219c4c4c9a1f who.out
64f0a22247fcb0b3aad4be8300a0da942cd09b90e5fea2eab00fae1529e781d1 whotext

File diff suppressed because one or more lines are too long

56
tests/fixtures/centos-7.7/sha384sum.out vendored Normal file
View File

@ -0,0 +1,56 @@
13dfec928ddd0b8ca477868a2aa8c56b6cf85fe8745f952671e0b0fe52315c4f8500b94ebabfd572cc6f942875c4f17f devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
75f6c510781b37878f4168a3224b64f49fe6320289fa004579928d58fefb5ceaf91b5af6d431713e2b43dae1b2aefb4a digout
31ca9016e7cdfeba9b8ddef08e34efcf7a45369e890ac4bd57e5336617ebead1f911d8fcc91a8bdb1a86c3512f024a1f dmidecode.out
38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b file with spaces in the name
10efecdd95d23b6a29ae311dd906b24a5c90e2ccd59872b77bdcaa7f55d32d9a95e145b9e1a1208708e9b7cadbe9edab id-centos.out
012fdcea79d9d6a59dcd474f2d9535b2ac9d3a2740709b7de6f54674976537e1361da8f46af4cf465840663267f0f55e ifcfg.json
480e4ba8cfd4fdd25113f518e1b5fb875b398c23b02959bec87ea0cb47e5b6fcfc1d8bc80c208777101c54fc5903cb98 ifconfig.out
485c03f413b3beb95efc2bda08b16804904ccac985eadecb75d52dd91bba2c2601145d51d5ae26568319bf54d0d688ca jc
e732bea551ada4e3254fc339aeaf424859bfc02718e985ad66fee9fed41dcc61cc87f07d648dbf69d32f72eee268ffdb jc-1.10.5-linux.sha256
2d7400f179eb7c2a43eaa0879c074ed46acd867aafd1947ffd7e9916d32fef55d48c93ac34c75d5931ac84f2b39b4101 jc-1.10.5-linux.tar.gz
5a9762aa33c4dfcf9fdd7fa8c94574f489117497bedced5527e4881c16712a90e2fca9da9a5254ef7dbe294d0a7cd736 jc-1.10.5.rpm
b16c7a5c51f15bbab9d30270f24f2a95cec840dc24e30fc52806cc110b55a2440c9597f69115f1db7bb9bc3d4fefbbf2 jc-1.11.1-linux.sha256
4ef3741864807f19da58e2c74a0ff2a95f2cc92030f315b9cca5d8a1592f64493bc91ad8a567a4c01e4fd5068964ff9c jc-1.11.1-linux.tar.gz
04bb4b8b79c4dfb6b978ce467b9451a71d3b1e3c5c42d16eab4b918308ffc9ceb7730cab077764705f8e5cc7d4a2fa3e jc-1.11.1.sha256
7b507374c22cb5f169980453d9e2a661505bb20260f079d3e0cd0c4b751ec75f3d3390b8f8d7290b6d748e9057af7377 jc-1.11.1.tar.gz
1020219aa19a10478b870c9195602c1f22766aed751d05272ea8a6a1dd04c0f8bc030b8906eb6dbbb0194fbd63a5c204 jc-1.11.2-linux.sha256
40207fa8a89b7d9dbbbbf76d155e12f2f8664f929c88367eac6257b0f617343d08b27e8daea1598ac77e27d47d3f9e28 jc-1.11.2-linux.tar.gz
2b5bf8c4e623f02f8e75ba352206e36f5c5e049d8b8dc4f33e3fe93465947c0a28af2a4505cd55ae6f8f328dd7db978f jc-1.11.8-linux.sha256
76bf73980528612ce2229e4fa0ae6111092c31e1a5593efd3870aba40e1a2c8651ef9cb3e9fbb607a1cfab246f489327 jc-1.11.8-linux.tar.gz
3d6bc8c0e43d5d46c786e5a6ca1fe21001997a3eae0aee3b04faec8f592ee4bd40bc84511cec23b1d8bd74569499d3cb jc-1.13.1-linux.sha256
adc8bea97698073f9c382788a7f60f906019255e23f98b4997ebae0146351f7ae365d12cf60b359c6c94ee338524a729 jc-1.13.1-linux.tar.gz
60b43d3431dd2a4d214b66b1752449a8c43ec01b3ace18661dd5485d4d3bae98fd83ea4c01c2cff5f9038ac7cec4f7b4 jc-1.13.2-linux.sha256
8a44aa9777fa63320ffc16b75da5cfa5c45ca8d6a47f49d06b719e251c7296aef23b471c3ba55d12bb530fedaf962303 jc-1.13.2-linux.tar.gz
03991acac3c3ae520604c949e8e3dbc62ab13a9d031b29a983b7ff28853adff1fe206f14937035f4219c7f5e56dc2571 jc-1.13.4-linux.sha256
60f2939c9dcb700e3ef7b258e460e49d3ec650c36a4bab107ac6eb55c7f587b242fcb50d81b0fd1739df6261b26674c0 jc-1.13.4-linux.tar.gz
367a0c7423ea4541372b6e04ecd453b9d39346b05739debbfdf2e7e037db469bfc7b16b25be3a252b1927284023201c9 jello-1.2.8-linux.sha256
d44cd208c480d0cb212483225e16fe85944dbd608d67ad9e40ee5868948a3822f64087567e4da096ae0004cb60055f15 jello-1.2.8-linux.tar.gz
008370792aa150cdcb54eb13810e9acce56ae1ebfe2d63cc75529e3caf86f5f9573157dca932d448a43c7f3e05c242b3 jello-1.2.9-linux.sha256
4433710be95f6a2bddf213fbd6d0c85a763c6043b09d00a863f6903d09d00c6167277bd32ae77c8fc943d7753f682a0b jello-1.2.9-linux.tar.gz
655ef2c57cf0bccc47853bc11e20b3ebf4c3fb6a65c63d2389983425e95081ab1f2e70a557932037846b35c5f3db7b2a journaljson
a7723d2c9aad90303866d1bed77cca43a7f88bdd6956a23d6b24767c1abadbd26d3a5d01d39af5305f0f0be49c596313 jp
3410d5208919ab9b336fdedcb06f647666eb5be9c2cb887256aa67406f971b845985ba6c3c9f7152f3ded6b6f4c683d3 jp_1.1.12_linux_x86_64.zip
1c9a0249597bdf89590091c41a21020c4805adb89e9c40a85359c99a2faac2cb4b9c3c80c4535064e3a263c285a773f6 jq_twitter.json
351c7b0459e35fd87e9ce2957d58a73e5c55d72ddf2429f37a989bd69d9c9ad5c7e8a9885f989e3e56ee1d50a9627a55 jtbl-1.1.6-linux.sha256
b6053a4bdf2bcc87c6ee2dc6d1c5572c1a78b1060d8a7f21dd6bca950cdf1518515df16b1f83dfecea2f498f1be23fac jtbl-1.1.6-linux.tar.gz
6f149d8f1a8c41a480b21f815537beabd97107358038c406b88f285c6637504c7d70f0fe4f3609ea55be35cc6267fb45 kbls.out
343bb57833a3629596d7fbfb0a7a56a5b775a5bb660773071f8c68ab9c8c84ceb3bdaf9ef8067fedc655627ba4d61a8b lastb.out
de0c500038bdeb1f57aa3789f74c630862cf3dbb83e9a8140d071959e048d8c144f190a9039975fe1d28c97982d80675 lsblk-cols
8debc85c75c169ded39bc8e91ce752c791d63df52f7aa8c7d110a755f764e41f2cbb4ef89650652971e7e76576662982 ping-ip-O-D.out
b93bf926e1e202a13cf5d122be10ffc69f15843f7f419f4b8e631d5ad0d4efd4123e5d9fc64b220ee906a5731c169d84 ping-ip-O.out
61f62147b30c6027548e04154c79548667853afdd930223183c96d13c484bda9251150e81ab8da86fcd15be8eb533aa8 psfile.txt
82fa64a5e3fd3c54a9f7c32c7407b2134bbc3826b66d66a95c7f673a5c6b8c9190cfdfba6c0dde858399cd680cf4ddaa resizeterm.sh
1da45fcd09bb7fe5d4805fc4a550dfa893c99c968568ca28c3c075f201579ff862f160bb80bcdda0b2276f35ebe0300f route-6-n.out
5ae84602fda703c954ae735d99a5b9b8ba31ae4967c2e647f91ea4199da1bd3a7467346272cdc217eecdf157802d4e45 route-6.out
dfc31420a5bc92730403711c71cc8e7939792c6c43d9cdead33673e6a37615a37d109c844643dc0308f84187d6ce51ff routeout
0d16335ada920c8003d571a33087ebc67e2183c069231ff949bb2f0f90df0bad99903a5db7aa5d21954de476a77b1ff9 shafile.txt
dceaccf3fa9161ca1f658f14dfb2b005f0737b8bc128d459ed60850964182e7a311446019ed93d00341f300aa2c4dc33 ss-aeep.out
9d72cdff3306fb0c14fd270e5dac3a07cd01163a529d57d6d36b761e9d4bfda458f73ddf55c2e352cd382e8d8d1cd7b5 ssout
7a33126d2954e2b295da2672219b1a4e6a30775c9c5da56832b1e9c89c9827846394bef5d22960e3b24e1dfd721061ad systemctl.out
90ce1a3b0ec04b9c96d50abe52956ef66327324dc9295cac734d69386ce2a280bc95baadd87b9f175f1272066b90804d top.out
0435b36b1ca56d7af51d42c73cc12c5fca6e559047c264e0945426958143aa6380d2e7ed22ced18cf4efdbfe454b23dd tracepath6.out
ab22a6cd069cc3e92da92aa09c807e75aa4fb98c495ae51a09b7231e2299773af32a901fadccd4d1dfbea6bfdfaafdfb tracepath-cnn.out
ad02ffb0876c5a7407034d128b5bc3a158e9cea4ba060b99062d2d2c12f2c1130826e8196b879f271254a46d69e9e450 tr.out
2c3b90566c37f9a900497ff58824943ad029c13a7db4b3e04d453cd7163c21e2da330a7e8b45084da68755d7aa7771e6 who-aH.out
873f8c55de4f8e24f1a355fde9da07bba0b8cd74271c194a101f7478e7b5464bf4e8f708da48d9439af0be8c298a94eb who.out
230ddb573e3b9c83389fcb358603d944bb20ed3603cdd45727bcda6f1e366cb6715676ec4bc19c6db8e427e45ca696b6 whotext

1
tests/fixtures/centos-7.7/sum.json vendored Normal file
View File

@ -0,0 +1 @@
[{"filename": "devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm", "checksum": 7391, "blocks": 23585}, {"filename": "digout", "checksum": 64318, "blocks": 2}, {"filename": "dmidecode.out", "checksum": 35461, "blocks": 271}, {"filename": "ethtool.out", "checksum": 13394, "blocks": 1}, {"filename": "file with spaces in the name", "checksum": 0, "blocks": 0}, {"filename": "id-centos.out", "checksum": 57353, "blocks": 1}, {"filename": "ifcfg.json", "checksum": 15991, "blocks": 2}, {"filename": "ifconfig.out", "checksum": 16654, "blocks": 2}, {"filename": "jc", "checksum": 12379, "blocks": 57387}, {"filename": "jc-1.10.5-linux.sha256", "checksum": 33170, "blocks": 1}, {"filename": "jc-1.10.5-linux.tar.gz", "checksum": 38975, "blocks": 21464}, {"filename": "jc-1.10.5.rpm", "checksum": 36555, "blocks": 21208}, {"filename": "jc-1.11.1-linux.sha256", "checksum": 5771, "blocks": 1}, {"filename": "jc-1.11.1-linux.tar.gz", "checksum": 33621, "blocks": 19753}, {"filename": "jc-1.11.1.sha256", "checksum": 63721, "blocks": 1}, {"filename": "jc-1.11.1.tar.gz", "checksum": 25235, "blocks": 19752}, {"filename": "jc-1.11.2-linux.sha256", "checksum": 3427, "blocks": 1}, {"filename": "jc-1.11.2-linux.tar.gz", "checksum": 64653, "blocks": 19758}, {"filename": "jc-1.11.8-linux.sha256", "checksum": 61535, "blocks": 1}, {"filename": "jc-1.11.8-linux.tar.gz", "checksum": 11356, "blocks": 19768}, {"filename": "jc-1.13.1-linux.sha256", "checksum": 413, "blocks": 1}, {"filename": "jc-1.13.1-linux.tar.gz", "checksum": 5236, "blocks": 19794}, {"filename": "jc-1.13.2-linux.sha256", "checksum": 30467, "blocks": 1}, {"filename": "jc-1.13.2-linux.tar.gz", "checksum": 6369, "blocks": 19789}, {"filename": "jc-1.13.4-linux.sha256", "checksum": 3858, "blocks": 1}, {"filename": "jc-1.13.4-linux.tar.gz", "checksum": 48299, "blocks": 19790}, {"filename": "jello-1.2.8-linux.sha256", "checksum": 9721, "blocks": 1}, {"filename": "jello-1.2.8-linux.tar.gz", "checksum": 22933, "blocks": 19434}, {"filename": "jello-1.2.9-linux.sha256", "checksum": 22600, "blocks": 1}, {"filename": "jello-1.2.9-linux.tar.gz", "checksum": 42077, "blocks": 19435}, {"filename": "journaljson", "checksum": 13482, "blocks": 5874}, {"filename": "jp", "checksum": 32520, "blocks": 3347}, {"filename": "jp_1.1.12_linux_x86_64.zip", "checksum": 10701, "blocks": 1147}, {"filename": "jq_twitter.json", "checksum": 44828, "blocks": 721}, {"filename": "jtbl-1.1.6-linux.sha256", "checksum": 41413, "blocks": 1}, {"filename": "jtbl-1.1.6-linux.tar.gz", "checksum": 3616, "blocks": 17798}, {"filename": "kbls.out", "checksum": 54702, "blocks": 5}, {"filename": "lastb.out", "checksum": 14781, "blocks": 1}, {"filename": "lsblk-cols", "checksum": 12059, "blocks": 2}, {"filename": "ping-ip-O-D.out", "checksum": 18274, "blocks": 2}, {"filename": "ping-ip-O.out", "checksum": 7583, "blocks": 2}, {"filename": "psfile.txt", "checksum": 25564, "blocks": 8}, {"filename": "resizeterm.sh", "checksum": 14654, "blocks": 1}, {"filename": "route-6-n.out", "checksum": 332, "blocks": 2}, {"filename": "route-6.out", "checksum": 18331, "blocks": 2}, {"filename": "routeout", "checksum": 54044, "blocks": 1}, {"filename": "sha384sum.out", "checksum": 27372, "blocks": 7}, {"filename": "shafile.txt", "checksum": 29060, "blocks": 3}, {"filename": "ss-aeep.out", "checksum": 17438, "blocks": 27}, {"filename": "ssout", "checksum": 13282, "blocks": 20}, {"filename": "systemctl.out", "checksum": 14760, "blocks": 38}, {"filename": "top.out", "checksum": 12654, "blocks": 6}, {"filename": "tracepath6.out", "checksum": 1877, "blocks": 1}, {"filename": "tracepath-cnn.out", "checksum": 57607, "blocks": 1}, {"filename": "tr.out", "checksum": 33493, "blocks": 2}, {"filename": "who-aH.out", "checksum": 11896, "blocks": 1}, {"filename": "who.out", "checksum": 56023, "blocks": 1}, {"filename": "whotext", "checksum": 20360, "blocks": 1}]

58
tests/fixtures/centos-7.7/sum.out vendored Normal file
View File

@ -0,0 +1,58 @@
07391 23585 devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
64318 2 digout
35461 271 dmidecode.out
13394 1 ethtool.out
00000 0 file with spaces in the name
57353 1 id-centos.out
15991 2 ifcfg.json
16654 2 ifconfig.out
12379 57387 jc
33170 1 jc-1.10.5-linux.sha256
38975 21464 jc-1.10.5-linux.tar.gz
36555 21208 jc-1.10.5.rpm
05771 1 jc-1.11.1-linux.sha256
33621 19753 jc-1.11.1-linux.tar.gz
63721 1 jc-1.11.1.sha256
25235 19752 jc-1.11.1.tar.gz
03427 1 jc-1.11.2-linux.sha256
64653 19758 jc-1.11.2-linux.tar.gz
61535 1 jc-1.11.8-linux.sha256
11356 19768 jc-1.11.8-linux.tar.gz
00413 1 jc-1.13.1-linux.sha256
05236 19794 jc-1.13.1-linux.tar.gz
30467 1 jc-1.13.2-linux.sha256
06369 19789 jc-1.13.2-linux.tar.gz
03858 1 jc-1.13.4-linux.sha256
48299 19790 jc-1.13.4-linux.tar.gz
09721 1 jello-1.2.8-linux.sha256
22933 19434 jello-1.2.8-linux.tar.gz
22600 1 jello-1.2.9-linux.sha256
42077 19435 jello-1.2.9-linux.tar.gz
13482 5874 journaljson
32520 3347 jp
10701 1147 jp_1.1.12_linux_x86_64.zip
44828 721 jq_twitter.json
41413 1 jtbl-1.1.6-linux.sha256
03616 17798 jtbl-1.1.6-linux.tar.gz
54702 5 kbls.out
14781 1 lastb.out
12059 2 lsblk-cols
18274 2 ping-ip-O-D.out
07583 2 ping-ip-O.out
25564 8 psfile.txt
14654 1 resizeterm.sh
00332 2 route-6-n.out
18331 2 route-6.out
54044 1 routeout
27372 7 sha384sum.out
29060 3 shafile.txt
17438 27 ss-aeep.out
13282 20 ssout
14760 38 systemctl.out
12654 6 top.out
01877 1 tracepath6.out
57607 1 tracepath-cnn.out
33493 2 tr.out
11896 1 who-aH.out
56023 1 who.out
20360 1 whotext

1
tests/fixtures/centos-7.7/wc.json vendored Normal file

File diff suppressed because one or more lines are too long

67
tests/fixtures/centos-7.7/wc.out vendored Normal file
View File

@ -0,0 +1,67 @@
0 0 0 bin
59 182 1943 cksum.out
97735 543757 24150660 devtoolset-3-gcc-4.9.2-6.el7.x86_64.rpm
41 173 1196 digout
11810 38755 277288 dmidecode.out
0 0 0 Downloads
24 77 748 ethtool.out
0 0 0 file with spaces in the name
0 0 0 git
1 4 129 id-centos.out
1 164 1600 ifcfg.json
26 157 1278 ifconfig.out
0 0 0 iptables-tests
455649 1920906 58764280 jc
1 2 69 jc-1.10.5-linux.sha256
80475 458331 21978413 jc-1.10.5-linux.tar.gz
80635 456923 21716708 jc-1.10.5.rpm
1 2 69 jc-1.11.1-linux.sha256
74510 421533 20226936 jc-1.11.1-linux.tar.gz
1 2 69 jc-1.11.1.sha256
73756 421486 20225785 jc-1.11.1.tar.gz
1 2 69 jc-1.11.2-linux.sha256
73861 421614 20231427 jc-1.11.2-linux.tar.gz
1 2 69 jc-1.11.8-linux.sha256
74127 421977 20241790 jc-1.11.8-linux.tar.gz
1 2 69 jc-1.13.1-linux.sha256
74620 421848 20268540 jc-1.13.1-linux.tar.gz
1 2 69 jc-1.13.2-linux.sha256
74786 423881 20263630 jc-1.13.2-linux.tar.gz
1 2 69 jc-1.13.4-linux.sha256
74763 423408 20264188 jc-1.13.4-linux.tar.gz
1 2 72 jello-1.2.8-linux.sha256
72997 415356 19899656 jello-1.2.8-linux.tar.gz
1 2 72 jello-1.2.9-linux.sha256
73111 414558 19901109 jello-1.2.9-linux.tar.gz
6557 479675 6014042 journaljson
19009 66861 3426382 jp
4154 24072 1174326 jp_1.1.12_linux_x86_64.zip
144 55888 738160 jq_twitter.json
1 2 71 jtbl-1.1.6-linux.sha256
66057 377780 18224334 jtbl-1.1.6-linux.tar.gz
58 520 4152 kbls.out
5 35 269 lastb.out
7 95 1559 lsblk-cols
25 207 1751 ping-ip-O-D.out
25 187 1351 ping-ip-O.out
104 912 7786 psfile.txt
16 53 355 resizeterm.sh
23 159 1802 route-6-n.out
23 159 1814 route-6.out
41 74 690 routeout
56 117 6434 sha384sum.out
56 117 2850 shafile.txt
205 2004 26724 ss-aeep.out
205 1843 20190 ssout
58 179 1668 sum.out
229 1609 38746 systemctl.out
0 0 0 testfiles
0 0 0 tmp
34 457 5314 top.out
6 25 252 tracepath6.out
34 105 939 tracepath-cnn.out
34 113 1137 tr.out
6 36 355 who-aH.out
2 9 93 who.out
5 28 281 whotext
1490176 8218431 338121827 total

1
tests/fixtures/osx-10.14.6/cksum.json vendored Normal file

File diff suppressed because one or more lines are too long

145
tests/fixtures/osx-10.14.6/cksum.out vendored Normal file
View File

@ -0,0 +1,145 @@
460623577 307 airport-I.json
3884095294 348 airport-I.out
3823080718 2152 airport-s.json
1241296374 1423 airport-s.out
3662476788 2140 arp-a.json
394323902 968 arp-a.out
2211666137 2979 arp-a2.json
3627494309 1597 arp-a2.out
502389395 1686 df-h.json
400417014 1276 df-h.out
4180452583 1764 df.json
3870323211 1384 df.out
1350546134 438 dig-aaaa.json
3856026265 536 dig-aaaa.out
3740315618 5984 dig-axfr.json
749991410 3511 dig-axfr.out
1318143536 442 dig-x.json
1399488100 529 dig-x.out
968550755 1266 dig.json
1509929607 1182 dig.out
514470835 295780 du.json
222115381 221925 du.out
66574512 3589 file.json
3410084023 2890 file.out
3024780012 4715 file2.json
2271991347 4780 file2.out
2286919983 9646 group.json
3791479878 2823 group.out
2497587728 759 id.json
4055820469 386 id.out
1256465312 10823 ifconfig.json
2946141711 3779 ifconfig.out
2248805689 11375 ifconfig2.json
2826930050 3979 ifconfig2.out
1234289001 45274 last.json
3878741492 25827 last.out
2242924774 852 ls-R-newlines.json
2580385439 278 ls-R-newlines.out
1166655102 469418 ls-R.json
4218902119 133787 ls-R.out
872532263 4653 ls-al.json
1990624448 2111 ls-al.out
533361577 959674 ls-alR.json
1752728607 364578 ls-alR.out
2907773845 4684 ls-alh.json
518393231 2111 ls-alh.out
2219502793 91544 ls-glob.json
1750032845 19369 ls-glob.out
197387780 1162 ls-l-newlines.json
1407749418 583 ls-l-newlines.out
3137165058 355547 ls-lR-empty-folder.json
1563455321 128740 ls-lR-empty-folder.out
595722164 1450 ls-lR-newlines.json
1965541686 656 ls-lR-newlines.out
3798624201 498 ls-newlines.json
519911259 260 ls-newlines.out
3112030615 585 ls.json
1810995639 193 ls.out
902730595 7764 md5.json
4230488015 5683 md5.out
1401281069 672 mount.json
2768344217 349 mount.out
605824441 841 mount2.json
3636857655 464 mount2.out
483687891 151042 netstat-Abn.json
2899854826 76835 netstat-Abn.out
1556983 142438 netstat-An.json
4286408161 71005 netstat-An.out
2751687123 7246 netstat-i.json
2993948661 3354 netstat-i.out
3675238823 16929 netstat-r.json
1685265265 6178 netstat-r.out
4218947449 21015 netstat-rnl.json
1696885775 10055 netstat-rnl.out
2629842889 141195 netstat.json
2526059995 70387 netstat.out
339467726 14855 passwd.json
871931958 6804 passwd.out
4064107262 714 ping-hostname-p.json
414078650 400 ping-hostname-p.out
3098475978 714 ping-hostname-s.json
3273862883 389 ping-hostname-s.out
3643045541 706 ping-hostname.json
2961178857 381 ping-hostname.out
1965089944 2251 ping-ip-dup.json
926326060 1156 ping-ip-dup.out
3383292259 691 ping-ip-p.json
4030042554 381 ping-ip-p.out
339690015 699 ping-ip-s.json
813997878 375 ping-ip-s.out
3307987337 689 ping-ip.json
3560181069 367 ping-ip.out
2969280967 786 ping6-hostname-p.json
773946458 460 ping6-hostname-p.out
3681725921 788 ping6-hostname-s.json
1846670269 449 ping6-hostname-s.out
2925748820 784 ping6-hostname.json
1846085995 446 ping6-hostname.out
2213270797 9447 ping6-ip-dup.json
2488952539 5225 ping6-ip-dup.out
2942459290 683 ping6-ip-p.json
3995090292 355 ping6-ip-p.out
1775639128 688 ping6-ip-s.json
3951402708 352 ping6-ip-s.out
1191437562 681 ping6-ip.json
4079831039 341 ping6-ip.out
149164085 224 pip-list.json
1574360463 168 pip-list.out
2037155692 1067 pip-show.json
456333099 910 pip-show.out
317517160 99173 ps-axu.json
1884966502 60107 ps-axu.out
1247200492 71162 ps-ef.json
575731254 48758 ps-ef.out
3593483594 11817 shasum.json
359954755 7982 shasum.out
4238888192 35152 stat.json
1516293752 15599 stat.out
3548337072 46473 sysctl-a.json
3365777883 42505 sysctl-a.out
2602794741 1123 traceroute-asn.json
1064946112 323 traceroute-asn.out
138609038 807 traceroute-mult-addresses.json
2270547956 305 traceroute-mult-addresses.out
1099425196 793 traceroute-no-header.json
3762488639 166 traceroute-no-header.out
3109879112 1240 traceroute-q.json
2116677646 272 traceroute-q.out
281326074 2419 traceroute.json
2303838391 579 traceroute.out
385060355 859 traceroute6-mult-addresses.json
1294841124 401 traceroute6-mult-addresses.out
385060355 859 traceroute6.json
680069720 304 traceroute6.out
4051060005 221 uname-a.json
3290829942 131 uname-a.out
272784635 7 uname.out
1952629296 110 uptime.json
174899653 65 uptime.out
3374858506 836 w.json
2080091923 570 w.out
235087184 659 who-a.json
859367914 419 who-a.out
2573389091 251 who.json
2013191876 128 who.out

1
tests/fixtures/osx-10.14.6/md5.json vendored Normal file

File diff suppressed because one or more lines are too long

104
tests/fixtures/osx-10.14.6/md5.out vendored Normal file
View File

@ -0,0 +1,104 @@
MD5 (arp-a.out) = cd645f685a1e57ebf3bc4fd44a7f87b8
MD5 (arp-v.out) = f4a00c29e88f61b90df90fb845560008
MD5 (arp.out) = d6581a3e0cab3addca50055467478f62
MD5 (blkid-ip-multi.out) = 3350258648ce551b8c2bd34474626ddf
MD5 (blkid-ip-udev-multi.out) = ea53b01490770a7c7ae3dd949c4cc331
MD5 (blkid-ip-udev.out) = 886b05fcfde5d3260597f33ff06133c5
MD5 (blkid-sda2.out) = ce61777185a52166672aab2b47456f76
MD5 (blkid.out) = f96852cc8becd6ab7ef896157b75f83f
MD5 (crontab-u.out) = 1971d74d4503c38c8cba9a20950c7142
MD5 (crontab.out) = 79d08ddb75d959e66a77a880711a589c
MD5 (df-h.out) = fe0aca4e47216d2a6023afb83dbcacc1
MD5 (df.out) = b03b56e8c8aa7ffcc2c7263aa452b9b8
MD5 (dig-aaaa.out) = 65cb08b0527f1aaa5fd9af528e01fa93
MD5 (dig-axfr.out) = e14018715ac457a9c8221acc635423c0
MD5 (dig-x.out) = f899dca2cdd00cf6857f076d2c146544
MD5 (dig.out) = 87c94ba4aedf74b58f7ad1dd1be39fd6
MD5 (dmidecode.out) = 716fd11c2ac00db109281f7110b8fb9d
MD5 (du.out) = 5e6effd8e33d5603112e11b70154b594
MD5 (env.out) = f6649e65066f4f58ae322d590f60b21c
MD5 (file.out) = b31670a7e4374d3733efe061efd990b6
MD5 (free-h.out) = 791202071bba2f4ec186465c1eb72cb2
MD5 (free.out) = f60e300aeeec5e14f787fc64286ef881
MD5 (fstab.out) = 172d0b92d95b0add305e1633cd89d5e7
MD5 (group.out) = 7f9d72d4fbe5bb0d3dd03350362b7668
MD5 (gshadow.out) = 7f3fbc5f73010bbb3e0c119cf99f4767
MD5 (history.out) = 0dfd64d0491e5d4c5d31e6276da2ff2e
MD5 (hosts.out) = 09fc278fadbac8d2bbf48176eaaf036e
MD5 (id.out) = 4295be239a14ad77ef3253103de976d2
MD5 (ifconfig.out) = 2826744b3cd0e3c48771ce54e90dc39e
MD5 (iptables-filter-line-numbers.out) = b8649a444af2bddee903f168a41ce46f
MD5 (iptables-filter-nv.out) = 336e547bce260445882bf7e23b518a57
MD5 (iptables-filter.out) = e6f269961b7dc89fdf9b9890b6276188
MD5 (iptables-mangle.out) = 8c90c0e4b4d788eac17f3f46059eb925
MD5 (iptables-nat.out) = 63c9ad6dfae4aab5627f0aa315b280ad
MD5 (iptables-raw.out) = 84d1e56220d1cd71816b34e4f55708fc
MD5 (jobs.out) = 6d39d7fe623da58d78d68263f7f36c7d
MD5 (last-w.out) = e52003b655197e16eb22b56631581315
MD5 (last.out) = b6a8e0c710ffdff032363a60fbc6fe50
MD5 (lastb.out) = d54fd268bbb2c0c8d01131fc4c375d6d
MD5 (ls-R-newlines.out) = 10155b2f641ba164492e43a2a0d1e9f6
MD5 (ls-R.out) = d7122233dbad630ca41d43b887a25c25
MD5 (ls-al.out) = 1e2205fe2a9efbbb098121f5f1701a16
MD5 (ls-alR.out) = 29468973ce06788a31c1e7f896e7dc60
MD5 (ls-alh.out) = a623550a81b18e4ff0491acd668d64ea
MD5 (ls-glob.out) = 1ca05ceb4ac0ea884824d97c2ac2f4ac
MD5 (ls-l-newlines.out) = afc4e7099c12af1fd7149e79b5d6e13d
MD5 (ls-lR-newlines.out) = 18053c80357f38b46ac44810c3240936
MD5 (ls-newlines.out) = 725dc56e746fb8d50ef038ca90c99fbf
MD5 (ls.out) = baf35fa8f15d14cdfb9bb80d0d55bb99
MD5 (lsblk-allcols.out) = 92d1f8f7590656a8e2fe0e42ee734c41
MD5 (lsblk.out) = 911234ff25f9db205dbe0504c601e37e
MD5 (lsmod.out) = ebfe5f57aee09dcdb1f0b299fee596aa
MD5 (lsof-sudo.out) = a275bb6d9f2528bb4b66a525b8a6d774
MD5 (lsof.out) = 6a72858a679e26efa5c66f54fe279295
MD5 (md5sum.out) = 7ea6da1b6f6baab8d9d952eb33378956
MD5 (mount.out) = 34159c041f57a7f2a86424cd2c49fed3
MD5 (netstat-i.out) = bd982936895b6df38a7fdbe86df8bf5c
MD5 (netstat-l.out) = 8fbb9c077bdf66c17c112c8a11b1e733
MD5 (netstat-p.out) = 9f2db696db8338cee0c56efc253e1f6a
MD5 (netstat-r.out) = ffcd2cc4ab8699f06f4705e7103b879f
MD5 (netstat-rne.out) = 3e119bbbd3f6dbb432d27dc29fec8f98
MD5 (netstat-rnee.out) = 27f2be6ede761a53ae573de06fd3d0d0
MD5 (netstat-sudo-aeep.out) = a8f7a37a3261bcaef6c6a3620e49464b
MD5 (netstat-sudo-lnp.out) = 4e46e684a905957b8e6d04b1a1c244da
MD5 (netstat.out) = 928d2f5d9f27fd6645930c4178cce819
MD5 (ntpq-p.out) = f5f84643e4240025307caab50f8990a9
MD5 (ntpq-pn.out) = 2b2fa305e490f388bd85684c0b26e2bf
MD5 (passwd.out) = 2c0199adf1b3e018c1945860f8372619
MD5 (ping-hostname-O-D-p-s.out) = 5b660694bf79aea1d52a392ff1092448
MD5 (ping-hostname-O-p.out) = ab4ff8264db941a0662b5b731ab46af0
MD5 (ping-hostname-O.out) = 1d9af746b203413e0ffc211f3185a8e4
MD5 (ping-ip-O-D.out) = 9ab7407b788aa94b95fe49dbc131b2cb
MD5 (ping-ip-O.out) = 969a0243a76a3bf407e3a24082af8068
MD5 (ping-ip-dup.out) = 35204577e61b34a55df836f7b4920c7e
MD5 (ping6-hostname-O-D-p-s.out) = be18cfed73d79091dcc665e5887903db
MD5 (ping6-hostname-O-p.out) = bf28730f5973b3d37f9f42d80b6858b1
MD5 (ping6-ip-O-D-p.out) = 2665133538e2d4a0828204522227a5e6
MD5 (ping6-ip-O-p.out) = bc03b9e491ecb25155e44082a8254f19
MD5 (ping6-ip-dup.out) = ff5e5d69174a3240e87432827dd5e25d
MD5 (pip-list.out) = 99809973a445fb2801a3bb14b4bc03bc
MD5 (pip-show.out) = 691ef00b38abbdbd2e8cc1ea856b9d83
MD5 (ps-axu.out) = e913baab1861defe5c69cc4bb6475779
MD5 (ps-ef.out) = ed826e38db572628ca5a2d70435a6302
MD5 (route-6-n.out) = 7bc3917b8b7e8aabd1ea853dc03eb431
MD5 (route-6.out) = f9691632cd72b4e956bba68d6d93a0fc
MD5 (route-vn.out) = 3e119bbbd3f6dbb432d27dc29fec8f98
MD5 (route.out) = 439adfcce99306d3419ec0fd7760f383
MD5 (shadow.out) = 9da686e5fb53fcb4c3934f7fc2859b5a
MD5 (shasum.out) = dcecd94ddf63d7fd70c2636fd723289b
MD5 (ss-sudo-a.out) = ee2ed1455bebac67298a72b83bdfb85e
MD5 (stat.out) = ea9e5cc3f2ec9971b5c43203e17801ac
MD5 (sysctl-a.out) = 9db459aaf7689f8c66911b57b05a5b9f
MD5 (systemctl-ls.out) = db3a53f9828d305ff294764ad6d3f860
MD5 (systemctl-luf.out) = adf988243f7ff5a2f71a5868031e5ec3
MD5 (systemctl.out) = 446fb73dbc66db1246d044386c4e57d6
MD5 (timedatectl.out) = 47bd61915dab99979127fb3dc1b1e493
MD5 (tracepath.out) = 269d7cf5b938004f251dc7824e601198
MD5 (tracepath6.out) = 6569334c8e6b6b22018f22c6628f0797
MD5 (traceroute.out) = 2bf8b3c7bc6e175ebb21fd0102f6b2b9
MD5 (uname-a.out) = 38ed43650f1fa000d196b391aea1c96d
MD5 (uptime.out) = b27aa536d962989c2639b9f022bd365f
MD5 (w.out) = 1a93af5b819721a085166825024a615e
MD5 (who-a.out) = dceb435d3c30ad3fad4102cea4ed461a
MD5 (who.out) = 19e19c6f49753ff44e85f4a82539592d

File diff suppressed because one or more lines are too long

142
tests/fixtures/osx-10.14.6/shasum.out vendored Normal file
View File

@ -0,0 +1,142 @@
b6701d0bd547292d2a51541cefdb78589c4ebc65 airport-I.json
3749387a837ee7e47a14c172b7b4eb922d569201 airport-I.out
0baafe93a582feff71e80ccc6d392cbb35fbea11 airport-s.json
4ae92f7948a96e95316ac2da00c162daad18802b airport-s.out
a214bc7b92039d33b0a9ee1ee343df6b6d81c11f arp-a.json
713e3d0a664c8ae8bd9a87c91269c22fca558849 arp-a.out
c8ede52d8e96ab137d56e5d9ccbdf0739300039d arp-a2.json
a8cdbf7229c45386c09a842100011421ab74adda arp-a2.out
3eea0498b884eb626b3f36484ceb46035626607a df-h.json
bec48433f817a8ab28699d4b4410935fc054e7d7 df-h.out
0cc078c31215b815519928597108fc08d6974abf df.json
41ea13d77c82c840bf014c2d68e494bf5f090e86 df.out
3e70a7cba6aaa1a873e845a54336adf67fe66b1e dig-aaaa.json
22417524735d1281e202a7a803c4721d7a212e4d dig-aaaa.out
0c476125b50536e31521597da15ecf1007c01056 dig-axfr.json
66220fa199b9c59cf980bb5b3eefcbf7454cf4f7 dig-axfr.out
47c5bc3266cdc42e9f64007dca72d59a30e910d0 dig-x.json
9f49a5c47cd70a52fd59a801cc5a5ac7c0ab6b74 dig-x.out
41f3c14ec6bcaa040b3c139447c6c08ef2dc322f dig.json
2c2efae28e1a5bba3da1f5fe10d7a48451dcad61 dig.out
ca632dce5c358eb19189972a6ce3eb7bac410f1a du.json
4709f16a60b101dd624880abcb6917cb3b052da6 du.out
6641aa32d84f1036e72592fefa16819788761dd6 file.json
64aa7e0a87d8f337a1affa434b7bdcf973be5a04 file.out
c011e362d46b8bb3fff6670c3506ca103045f4cd file2.json
dfc3c3c4af63be1909e44443b3b90e10b687d6c8 file2.out
260404f3d2096264f5ca8570ca3295aa5e282878 group.json
39ebabcaf4296712c3e32edb6133bca98a2455e8 group.out
7f1718884b12c28035847719a19ea415e7215bb8 id.json
28a7474eed1b514fafb0d8b33ade8a1b7b261546 id.out
2ed6453465f3fdb41520599129741c8955e0e956 ifconfig.json
bb0bc5bb5d8891015373a6ff3d743ee9593de432 ifconfig.out
2ea05804d196a0bf9894d8106766b04d5bf89a11 ifconfig2.json
f46ecf7bb5be88af18d53415c31392d1968d2fc2 ifconfig2.out
3c2ec4597c76f026b4e635385a3f7e579b861bd2 last.json
f92c6ff31c0b520d41768a044c794670ce8d13cb last.out
54a0b33790ef7369fb901db4c45bfe5ef7e77edc ls-R-newlines.json
098c351f68519fd7ac37ac1721e64ad8ed4a3600 ls-R-newlines.out
22c3aabad0c0cbe32a2ed8bd4d1cef92a904f0ea ls-R.json
69861b855e1e7e6394da3645e853a3430e99e5b2 ls-R.out
8c1fc69e7a8e96d06566afa3a7759fcd17d77207 ls-al.json
4e6eb0ef6e29a436d15b3e380a6e34c57583e94f ls-al.out
67d5b302d734e71859160cb44b13b5cdfae03e34 ls-alR.json
5ee5666ccd067a72e0cff4d1b337c46858205ce2 ls-alR.out
31b53afda162e8ccf356916f2cc36dc73eb6b45b ls-alh.json
81e09c8a18b7e0a051147e697b83fdb5f88ab137 ls-alh.out
f9c06fe2c8a2a44987112d16d29cea359d67c4e4 ls-glob.json
6d38df7da56e2b898db200cbc68ffa2f9324b567 ls-glob.out
839158b81641f70e09fae84c5f11d4fa3d371922 ls-l-newlines.json
21999fb50ffff3d098ff5cb44de92002b8637611 ls-l-newlines.out
58e4a9d0deddd57483880b4f509f769fa1df6514 ls-lR-empty-folder.json
827125e173a978aaea11b6170dfbefb3dab30375 ls-lR-empty-folder.out
28b5390d64492453187a5c3e3548854bafa5a3dc ls-lR-newlines.json
5b17d8c3c27c90cce7fb2c42e79ac94d5f79fba4 ls-lR-newlines.out
5f1a2ab24626d2819bab4c5f1f974b4dcd32d18d ls-newlines.json
f103cb8013553c1c997d151449a519090c844c4d ls-newlines.out
8dbfd075967f928fcf773cdf740abc3442e1e7de ls.json
e378d603819b3ba7a4615151f3cbdd8c985c5278 ls.out
e6169a0ab655b81d17ca46460f4bf4628e3f15c7 md5.out
3427962301eb775c296a75532ece6f24197723df mount.json
6301b0589f75e4190e37ec071068a9a43a6ba6b9 mount.out
e32f5571cb2995d01e336076a84ded88f2dce782 mount2.json
9c90e82e74c553bf649b1a43047cd9c062006fa3 mount2.out
4c210803690e8eabbdfd00c1346014d7b99ab5e2 netstat-Abn.json
45b809ce7d4c68685ee9293c07640b1e5fb3420a netstat-Abn.out
1be1890e206000e8865c81a7cf1c5ac17cc5e9e1 netstat-An.json
1a7c5cee6339d8e22973a31542ae62f330fa4057 netstat-An.out
a9cce6324e62373b66066ab6a292b121ae3fb121 netstat-i.json
1d699a308356aee6179caa84a07940f32c262a33 netstat-i.out
4a851ca343d7d17ece41cb66e9c1f5d046281514 netstat-r.json
04b4ff8c424c836beb179f24402e09df6b91d8da netstat-r.out
b10b6ce7d98e61c4f819fc06aaa3ba4c11e6196e netstat-rnl.json
b354f8cdfea44bb84fc8b9f16e40621387b1e20b netstat-rnl.out
eeb92d12bea70acc01bbe015668f774dda779fac netstat.json
00cc660ce9de89889435978f4e82aac8d30352ba netstat.out
ad454cef94895c6f32538dcc57e5c35609543f0b passwd.json
98b96a259d79f457c619dfb4b5949f03f9ee0e91 passwd.out
affe7ac91927e00c05da4c4f0b985da7feb94ee7 ping-hostname-p.json
22f6da2c47dfafcdf2921bbd0dd664a59c118017 ping-hostname-p.out
37573a86ea3bc3a66fe5a401e0259e9ba86bd7e2 ping-hostname-s.json
3515f57ef15df3b015b1e589eb76298c6923eee3 ping-hostname-s.out
70cae13fff2b53913bc279bad20ae6502b93142c ping-hostname.json
805da101ba12f150e5164352cc61634fe08a6f04 ping-hostname.out
463ab3f969bac22b644c3e60c9b33db570c50ec1 ping-ip-dup.json
f051d883e339ce8bfbee8d14ddc68007aec2ce16 ping-ip-dup.out
6c433892a236a8b56c38c92ab65d958a81b25015 ping-ip-p.json
fbec6b8034ef32a48dcd392c8d8d7a8150720cee ping-ip-p.out
a8e7418abf65967c554f6006a6d18d1103936b56 ping-ip-s.json
d688174811c7e7df05135bfb7d53a2ce91878632 ping-ip-s.out
a8bad79ae89852a0d6f42f78c0d3b651e825f62f ping-ip.json
30e35e7a4b16c9e0332e4cf5ae7d4a6e90e2ad63 ping-ip.out
aa762025cefbe4f9a481ba622ade333ad3d3f946 ping6-hostname-p.json
534382c4698f18187ded6259576f08da0a6f338f ping6-hostname-p.out
6600a05b117ddcfc80ee3554176857a78b18325a ping6-hostname-s.json
f86a97e16952be0e70b7c7fde247d2793230ecdc ping6-hostname-s.out
9b2c9765859a05d8ae779764284db45d9dea742c ping6-hostname.json
1782a580d6d92d38a64e02fca30b936c1bacc05d ping6-hostname.out
838ef123a0000e59271d4703c7ac6c4a7d3eab7e ping6-ip-dup.json
0d3af3ab2a5c5f886842abc0bfe06288307604b3 ping6-ip-dup.out
9911d8c4d08f3ba111c6b24dbbbecab701e4a371 ping6-ip-p.json
b176952e7b3fbc0f94c9b6aa261e7a239938621f ping6-ip-p.out
0fa62d9840efc9867c7c74458474c4daa6725e0e ping6-ip-s.json
bed5d50ae2be215b612187f109046916a7071bdf ping6-ip-s.out
d229293a2a0fd0e7c04d65202a58de207a85db93 ping6-ip.json
b96290f3f61068eef9c79e52155560a9f6eebb24 ping6-ip.out
3a095f602ade8ab11443ce8321288dc8a52f4eb6 pip-list.json
684f9f178d8a4a9183bdfa91139b65fff7a8bd02 pip-list.out
2775dfd4a51a3b7a6eb41effa9299e72377ac573 pip-show.json
c9159fd0cd5af49fd81a6181b38161072a0a8536 pip-show.out
b68b29c17b6877bb014a8b99d528ed15476c9ff1 ps-axu.json
c09f2435054539d3f891e803babfcebbc2e3d2c5 ps-axu.out
2a7bae5f336e662ef58fb1213d0f20c593f8e5ce ps-ef.json
a13032d2a724f4918a3c4941c4babaf55f2c7a40 ps-ef.out
a95208df396194dac9b1196f3bbe989e174fc3fb stat.json
301016ffc0cbb6a0ebb4a31987aae2208068af45 stat.out
d791375d84f3c209bf71f637e76d46d1fe4459c7 sysctl-a.json
61827f5423ee2a3891f38b23baf671676869d930 sysctl-a.out
0096b180a1674f935df6e7314db0f3aac3d15758 traceroute-asn.json
14983d7528df1dc1004b254991e49cba30cf9861 traceroute-asn.out
5cfde477f5e966db9887c4ac6700e94ec3f5e214 traceroute-mult-addresses.json
b05bfa6c8371c68eb5d761de6b7a7933c3dba78b traceroute-mult-addresses.out
92b288e194981920428fbb910717a3ff17605fd0 traceroute-no-header.json
fbb81722ae676195c0f44f0f8c41bd860fb33b52 traceroute-no-header.out
17b5bdc7456d2cda893eba40e5568d6e4835c2ce traceroute-q.json
cb777f386ff2f81c6516b560a4ddea149235f573 traceroute-q.out
f62ee48530285cb1cecd5ef0dc4e8cc16b278676 traceroute.json
d080112c55e7fbd6578720fe290db6dea2d8df46 traceroute.out
94e80f496b128bf459cf59ac07d5645be70e5b8f traceroute6-mult-addresses.json
67677c5474a466a6c1ae86557077326eed70db71 traceroute6-mult-addresses.out
94e80f496b128bf459cf59ac07d5645be70e5b8f traceroute6.json
526c631415d055333b4f29adca186bfe7f498dca traceroute6.out
9ac73b33611d1cee071cdb224178c4ea4c164804 uname-a.json
ac286f0f6e2bb695f693674babdae22203765a79 uname-a.out
0fc09dc308ca8159ed485d2c5aad6139eab3d44b uname.out
43f78bcbeb78e30f0df5ae0e988605627a453c72 uptime.json
bfbfc9814f48e430aef9579bb6bfd4873b257a17 uptime.out
2ecd2bd1a1c243852181d00fdd26bdd471221f16 w.json
1d5f7d4db7d413717f661e95c239312b94045ebc w.out
31d74136f77fff6ba685e43d17097b045642bbec who-a.json
2e6094a345b9f3205decacba3d7f1fcf8471dd82 who-a.out
0b6eddc1d363f49c46c963b97dc0387e9e7a23b7 who.json
996aa62bdea95a8c4561f4208db3fd7719eb695f who.out

1
tests/fixtures/osx-10.14.6/sum.json vendored Normal file

File diff suppressed because one or more lines are too long

146
tests/fixtures/osx-10.14.6/sum.out vendored Normal file
View File

@ -0,0 +1,146 @@
38391 1 airport-I.json
10927 1 airport-I.out
19081 3 airport-s.json
63504 2 airport-s.out
60887 3 arp-a.json
18964 1 arp-a.out
63795 3 arp-a2.json
46674 2 arp-a2.out
49539 5 cksum.out
64766 2 df-h.json
415 2 df-h.out
37365 2 df.json
12639 2 df.out
8111 1 dig-aaaa.json
50417 1 dig-aaaa.out
43183 6 dig-axfr.json
28178 4 dig-axfr.out
2727 1 dig-x.json
11169 1 dig-x.out
40945 2 dig.json
61726 2 dig.out
38720 289 du.json
16890 217 du.out
37280 4 file.json
9660 3 file.out
29539 5 file2.json
33868 5 file2.out
50477 10 group.json
55547 3 group.out
21649 1 id.json
26181 1 id.out
17770 11 ifconfig.json
10956 4 ifconfig.out
35645 12 ifconfig2.json
38293 4 ifconfig2.out
36756 45 last.json
23587 26 last.out
30013 1 ls-R-newlines.json
42103 1 ls-R-newlines.out
37108 459 ls-R.json
63758 131 ls-R.out
56923 5 ls-al.json
15531 3 ls-al.out
1382 938 ls-alR.json
4461 357 ls-alR.out
57950 5 ls-alh.json
6947 3 ls-alh.out
31393 90 ls-glob.json
1019 19 ls-glob.out
57505 2 ls-l-newlines.json
41948 1 ls-l-newlines.out
11529 348 ls-lR-empty-folder.json
58132 126 ls-lR-empty-folder.out
6935 2 ls-lR-newlines.json
41356 1 ls-lR-newlines.out
9894 1 ls-newlines.json
57269 1 ls-newlines.out
17338 1 ls.json
52477 1 ls.out
36019 8 md5.json
42534 6 md5.out
37000 1 mount.json
16534 1 mount.out
45746 1 mount2.json
55291 1 mount2.out
34181 148 netstat-Abn.json
5732 76 netstat-Abn.out
27697 140 netstat-An.json
26933 70 netstat-An.out
13656 8 netstat-i.json
7961 4 netstat-i.out
11407 17 netstat-r.json
18759 7 netstat-r.out
63267 21 netstat-rnl.json
62814 10 netstat-rnl.out
41515 138 netstat.json
32647 69 netstat.out
39641 15 passwd.json
19130 7 passwd.out
113 1 ping-hostname-p.json
6247 1 ping-hostname-p.out
12827 1 ping-hostname-s.json
23515 1 ping-hostname-s.out
21637 1 ping-hostname.json
18604 1 ping-hostname.out
26389 3 ping-ip-dup.json
19769 2 ping-ip-dup.out
24589 1 ping-ip-p.json
46644 1 ping-ip-p.out
33523 1 ping-ip-s.json
25608 1 ping-ip-s.out
8854 1 ping-ip.json
62691 1 ping-ip.out
49568 1 ping6-hostname-p.json
53253 1 ping6-hostname-p.out
25633 1 ping6-hostname-s.json
33091 1 ping6-hostname-s.out
7678 1 ping6-hostname.json
57086 1 ping6-hostname.out
22863 10 ping6-ip-dup.json
43494 6 ping6-ip-dup.out
39183 1 ping6-ip-p.json
34802 1 ping6-ip-p.out
40367 1 ping6-ip-s.json
51554 1 ping6-ip-s.out
57462 1 ping6-ip.json
36941 1 ping6-ip.out
29175 1 pip-list.json
20474 1 pip-list.out
37722 2 pip-show.json
18260 1 pip-show.out
24887 97 ps-axu.json
43405 59 ps-axu.out
62822 70 ps-ef.json
46842 48 ps-ef.out
29690 12 shasum.json
31405 8 shasum.out
30773 35 stat.json
27996 16 stat.out
54364 46 sysctl-a.json
56073 42 sysctl-a.out
60232 2 traceroute-asn.json
60268 1 traceroute-asn.out
7554 1 traceroute-mult-addresses.json
19479 1 traceroute-mult-addresses.out
14875 1 traceroute-no-header.json
62949 1 traceroute-no-header.out
12931 2 traceroute-q.json
52433 1 traceroute-q.out
45516 3 traceroute.json
2209 1 traceroute.out
12134 1 traceroute6-mult-addresses.json
52070 1 traceroute6-mult-addresses.out
12134 1 traceroute6.json
0 1 traceroute6.out
33535 1 uname-a.json
39634 1 uname-a.out
22645 1 uname.out
59092 1 uptime.json
45958 1 uptime.out
8647 1 w.json
16304 1 w.out
61006 1 who-a.json
8784 1 who-a.out
6467 1 who.json
27498 1 who.out

View File

@ -0,0 +1 @@
[{"filename": null, "lines": 1, "words": 2, "characters": 12}]

View File

@ -0,0 +1 @@
1 2 12

1
tests/fixtures/osx-10.14.6/wc.json vendored Normal file

File diff suppressed because one or more lines are too long

150
tests/fixtures/osx-10.14.6/wc.out vendored Normal file
View File

@ -0,0 +1,150 @@
1 30 307 airport-I.json
15 33 348 airport-I.out
1 202 2152 airport-s.json
15 112 1423 airport-s.out
98 170 2140 arp-a.json
12 99 968 arp-a.out
1 240 2979 arp-a2.json
20 162 1597 arp-a2.out
1 870 10244 cksum.json
145 435 4298 cksum.out
1 147 1686 df-h.json
9 85 1276 df-h.out
1 147 1764 df.json
9 85 1384 df.out
1 49 438 dig-aaaa.json
20 80 536 dig-aaaa.out
1 585 5984 dig-axfr.json
59 382 3511 dig-axfr.out
1 49 442 dig-x.json
20 80 529 dig-x.out
1 138 1266 dig.json
41 169 1182 dig.out
1 13448 295780 du.json
3357 6734 221925 du.out
1 370 3589 file.json
53 264 2890 file.out
1 458 4715 file2.json
88 282 4780 file2.out
1 1015 9646 group.json
135 174 2823 group.out
1 79 759 id.json
1 3 386 id.out
1 1107 10823 ifconfig.json
91 331 3779 ifconfig.out
1 1162 11375 ifconfig2.json
95 349 3979 ifconfig2.out
1 5483 45274 last.json
383 3261 25827 last.out
1 88 852 ls-R-newlines.json
36 43 278 ls-R-newlines.out
1 18354 469418 ls-R.json
5017 4805 133787 ls-R.out
1 550 4653 ls-al.json
35 314 2111 ls-al.out
1 82256 959674 ls-alR.json
4996 41842 364578 ls-alR.out
1 550 4684 ls-alh.json
35 314 2111 ls-alh.out
1 7272 91544 ls-glob.json
1831 1825 19369 ls-glob.out
1 138 1162 ls-l-newlines.json
34 99 583 ls-l-newlines.out
1 34164 355547 ls-lR-empty-folder.json
2453 17640 128740 ls-lR-empty-folder.out
1 168 1450 ls-lR-newlines.json
38 111 656 ls-lR-newlines.out
1 56 498 ls-newlines.json
33 41 260 ls-newlines.out
1 46 585 ls.json
23 23 193 ls.out
1 416 7764 md5.json
104 416 5683 md5.out
1 55 672 mount.json
6 43 349 mount.out
1 66 841 mount2.json
7 52 464 mount2.out
1 15133 151042 netstat-Abn.json
689 5961 76835 netstat-Abn.out
1 14085 142438 netstat-An.json
689 5431 71005 netstat-An.out
1 840 7246 netstat-i.json
43 376 3354 netstat-i.out
1 1456 16929 netstat-r.json
93 435 6178 netstat-r.out
1 1940 21015 netstat-rnl.json
96 667 10055 netstat-rnl.out
1 14100 141195 netstat.json
737 5316 70387 netstat.out
1 1517 14855 passwd.json
108 292 6804 passwd.out
1 67 714 ping-hostname-p.json
9 51 400 ping-hostname-p.out
1 67 714 ping-hostname-s.json
8 49 389 ping-hostname-s.out
1 67 706 ping-hostname.json
8 49 381 ping-hostname.out
1 235 2251 ping-ip-dup.json
20 147 1156 ping-ip-dup.out
1 67 691 ping-ip-p.json
9 51 381 ping-ip-p.out
1 67 699 ping-ip-s.json
8 49 375 ping-ip-s.out
1 67 689 ping-ip.json
8 49 367 ping-ip.out
1 69 786 ping6-hostname-p.json
9 50 460 ping6-hostname-p.out
1 69 788 ping6-hostname-s.json
8 48 449 ping6-hostname-s.out
1 69 784 ping6-hostname.json
8 48 446 ping6-hostname.out
1 909 9447 ping6-ip-dup.json
68 530 5225 ping6-ip-dup.out
1 69 683 ping6-ip-p.json
9 50 355 ping6-ip-p.out
1 69 688 ping6-ip-s.json
8 48 352 ping6-ip-s.out
1 69 681 ping6-ip.json
8 48 341 ping6-ip.out
1 20 224 pip-list.json
7 14 168 pip-list.out
1 84 1067 pip-show.json
32 82 910 pip-show.out
1 8641 99173 ps-axu.json
378 4505 60107 ps-axu.out
1 6379 71162 ps-ef.json
378 3371 48758 ps-ef.out
1 568 11817 shasum.json
142 284 7982 shasum.out
1 4136 35152 stat.json
94 2632 15599 stat.out
1 876 9234 sum.json
146 438 3247 sum.out
1 2793 46473 sysctl-a.json
1287 2785 42505 sysctl-a.out
1 108 1123 traceroute-asn.json
5 44 323 traceroute-asn.out
1 75 807 traceroute-mult-addresses.json
4 39 305 traceroute-mult-addresses.out
1 75 793 traceroute-no-header.json
3 22 166 traceroute-no-header.out
1 115 1240 traceroute-q.json
4 42 272 traceroute-q.out
1 244 2419 traceroute.json
11 81 579 traceroute.out
1 83 859 traceroute6-mult-addresses.json
8 48 401 traceroute6-mult-addresses.out
1 83 859 traceroute6.json
7 40 304 traceroute6.out
1 20 221 uname-a.json
1 15 131 uname-a.out
1 1 7 uname.out
1 14 110 uptime.json
1 12 65 uptime.out
1 99 836 w.json
10 69 570 w.out
1 86 659 who-a.json
9 62 419 who-a.out
1 32 251 who.json
4 20 128 who.out
24562 360529 4491471 total

70
tests/test_cksum.py Normal file
View File

@ -0,0 +1,70 @@
import os
import unittest
import json
import jc.parsers.cksum
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/cksum.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_cksum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sum.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_sum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/cksum.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_cksum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/sum.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_sum = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/cksum.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_cksum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sum.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_sum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/cksum.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_cksum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/sum.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_sum_json = json.loads(f.read())
def test_cksum_nodata(self):
"""
Test 'cksum' parser with no data
"""
self.assertEqual(jc.parsers.cksum.parse('', quiet=True), [])
def test_cksum_centos_7_7(self):
"""
Test 'cksum' on Centos 7.7
"""
self.assertEqual(jc.parsers.cksum.parse(self.centos_7_7_cksum, quiet=True), self.centos_7_7_cksum_json)
def test_sum_centos_7_7(self):
"""
Test 'sum' on Centos 7.7
"""
self.assertEqual(jc.parsers.cksum.parse(self.centos_7_7_sum, quiet=True), self.centos_7_7_sum_json)
def test_cksum_osx_10_14_6(self):
"""
Test 'cksum' on OSX 10.14.6
"""
self.assertEqual(jc.parsers.cksum.parse(self.osx_10_14_6_cksum, quiet=True), self.osx_10_14_6_cksum_json)
def test_sum_osx_10_14_6(self):
"""
Test 'sum' on OSX 10.14.6
"""
self.assertEqual(jc.parsers.cksum.parse(self.osx_10_14_6_sum, quiet=True), self.osx_10_14_6_sum_json)
if __name__ == '__main__':
unittest.main()

34
tests/test_hash.py Normal file
View File

@ -0,0 +1,34 @@
import os
import unittest
import json
import jc.parsers.hash
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/hash.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_hash = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/hash.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_hash_json = json.loads(f.read())
def test_hash_nodata(self):
"""
Test 'hash' parser with no data
"""
self.assertEqual(jc.parsers.hash.parse('', quiet=True), [])
def test_hash_centos_7_7(self):
"""
Test 'hash' on Centos 7.7
"""
self.assertEqual(jc.parsers.hash.parse(self.centos_7_7_hash, quiet=True), self.centos_7_7_hash_json)
if __name__ == '__main__':
unittest.main()

82
tests/test_hashsum.py Normal file
View File

@ -0,0 +1,82 @@
import os
import unittest
import json
import jc.parsers.hashsum
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/md5sum.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_md5sum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha256sum.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_sha256sum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_sha384sum = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/md5.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_md5 = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/shasum.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_shasum = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/md5sum.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_md5sum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha256sum.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_sha256sum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_sha384sum_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/md5.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_md5_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/shasum.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_shasum_json = json.loads(f.read())
def test_hashsum_nodata(self):
"""
Test 'hashsum' parser with no data
"""
self.assertEqual(jc.parsers.hashsum.parse('', quiet=True), [])
def test_md5sum_centos_7_7(self):
"""
Test 'md5sum' on Centos 7.7
"""
self.assertEqual(jc.parsers.hashsum.parse(self.centos_7_7_md5sum, quiet=True), self.centos_7_7_md5sum_json)
def test_sha256sum_centos_7_7(self):
"""
Test 'sha256sum' on Centos 7.7
"""
self.assertEqual(jc.parsers.hashsum.parse(self.centos_7_7_sha256sum, quiet=True), self.centos_7_7_sha256sum_json)
def test_sha384sum_centos_7_7(self):
"""
Test 'sha384sum' on Centos 7.7
"""
self.assertEqual(jc.parsers.hashsum.parse(self.centos_7_7_sha384sum, quiet=True), self.centos_7_7_sha384sum_json)
def test_md5_osx_10_14_6(self):
"""
Test 'md5' on OSX 10.14.6
"""
self.assertEqual(jc.parsers.hashsum.parse(self.osx_10_14_6_md5, quiet=True), self.osx_10_14_6_md5_json)
def test_shasum_osx_10_14_6(self):
"""
Test 'shasum' on OSX 10.14.6
"""
self.assertEqual(jc.parsers.hashsum.parse(self.osx_10_14_6_shasum, quiet=True), self.osx_10_14_6_shasum_json)
if __name__ == '__main__':
unittest.main()

58
tests/test_wc.py Normal file
View File

@ -0,0 +1,58 @@
import os
import unittest
import json
import jc.parsers.wc
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/wc.out'), 'r', encoding='utf-8') as f:
self.centos_7_7_wc = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/wc.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_wc = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/wc-stdin.out'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_wc_stdin = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/wc.json'), 'r', encoding='utf-8') as f:
self.centos_7_7_wc_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/wc.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_wc_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/wc-stdin.json'), 'r', encoding='utf-8') as f:
self.osx_10_14_6_wc_stdin_json = json.loads(f.read())
def test_wc_nodata(self):
"""
Test 'wc' parser with no data
"""
self.assertEqual(jc.parsers.wc.parse('', quiet=True), [])
def test_wc_centos_7_7(self):
"""
Test 'wc' on Centos 7.7
"""
self.assertEqual(jc.parsers.wc.parse(self.centos_7_7_wc, quiet=True), self.centos_7_7_wc_json)
def test_wc_osx_10_14_6(self):
"""
Test 'wc' on OSX 10.14.6
"""
self.assertEqual(jc.parsers.wc.parse(self.osx_10_14_6_wc, quiet=True), self.osx_10_14_6_wc_json)
def test_wc_stdin_osx_10_14_6(self):
"""
Test 'wc' from STDIN on OSX 10.14.6
"""
self.assertEqual(jc.parsers.wc.parse(self.osx_10_14_6_wc_stdin, quiet=True), self.osx_10_14_6_wc_stdin_json)
if __name__ == '__main__':
unittest.main()