1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-17 01:32:37 +02:00

add cksum tests

This commit is contained in:
Kelly Brazil
2020-12-30 11:22:17 -08:00
parent 0431798178
commit 6da9510e46
9 changed files with 482 additions and 0 deletions

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/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/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/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

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()