Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rework toposort algorithm as an ancestor traversal #3646

Open
wants to merge 905 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
905 commits
Select commit Hold shift + click to select a range
780bcba
Feat: Add spec and parser for 'crictl_logs' (#3345)
shlao Mar 2, 2022
af8ae9b
Don't log the insights-core egg in verbose mode (BZ 2045995) (#3348)
mhuth Mar 2, 2022
d27b084
fix: Fix the regression bug of soscleaner IP obsfuscating (#3347)
xiangce Mar 3, 2022
3c969e9
feat: New parser for systemd_perms (#3339)
TZ3070 Mar 4, 2022
f5bc448
feat: New spec and parser to get capsules and repos with contidions (…
huali027 Mar 10, 2022
b6fbc31
Fix slowness on RHEL 8 by simplifying looping over pkgs (#3354)
ryan-blakley Mar 10, 2022
dcb9b66
New parser ktimer_lockless (#3355)
rasrivas-redhat Mar 15, 2022
370a512
feat: Add systctl.d spec, parser, and combiner (#3358)
ryan-blakley Mar 17, 2022
37ee1e3
feat: New spec to get satellite repos with multiple reference (#3362)
huali027 Mar 17, 2022
3c98505
feat: New parsers for IBM proc files (#3361)
xiangce Mar 17, 2022
fe6ecf4
feat: New parser for /usr/bin/od -An -t d /dev/cpu_dma_latency (#3353)
crackcodecamp Mar 17, 2022
82bbd8d
fix: Keep the results once one of them is good (#3357)
huali027 Mar 23, 2022
acbd829
status terminated with ok signal when wheter it is registered or not …
ahitacat Mar 23, 2022
ab819b5
fix: Switch to reading crontab file rather than run the command (#3359)
ryan-blakley Mar 23, 2022
b0c6aed
fix: Enhance parser Grub2Config (#3360)
wushiqinlou Mar 24, 2022
cf50a16
fix: Fix deprecation warning for using ET.getiterator (#3371)
ryan-blakley Mar 29, 2022
af5915a
Revert "fix: Enhance parser Grub2Config (#3360)" (#3367)
ryan-blakley Mar 30, 2022
5f1551a
fix: Enhance "PCSStatus" to make it compatible with new output format…
huali027 Mar 31, 2022
0e50b16
fix: Update bond and bond_dynamic_lb spec (#3372)
ryan-blakley Apr 5, 2022
3f19f4c
Enhance combiner grub_conf_blscfg (#3370)
wushiqinlou Apr 6, 2022
43737dd
feat: Add new sos ps spec and fix ValueError caused by it (#3377)
ryan-blakley Apr 7, 2022
8498c88
fix: correctly obfuscate IP addresses at EOL (#3376)
subpop Apr 7, 2022
a438f64
Fix BZ#2071058 (#3375)
Apr 7, 2022
b9a4550
New parser Ql2xmqSupport (#3374)
TZ3070 Apr 7, 2022
d29ea41
Replace “cloud.redhat.com” with “console.redhat.com” (#3365)
strider Apr 7, 2022
54c722b
Exclude some Specs from IP address obfuscation (#3331)
Glutexo Apr 7, 2022
81e3af8
fix(client): Return valid machine-id UUID4 object (#3385)
strider Apr 14, 2022
543697f
fix: Update the spec "du_dirs" to filterable (#3384)
huali027 Apr 18, 2022
dea3611
Only collect "*.conf" for nginx (#3380)
huali027 Apr 19, 2022
f644cf3
Fix spec for YumUpdates parser (#3388)
bfahr Apr 19, 2022
e24dd81
fix: strip the '\x00' from the ibm_fw_vernum_encoded before parsing (…
xiangce Apr 19, 2022
0186682
fix: Httpd tracebacks displaying when the client is ran (#3379)
ryan-blakley Apr 19, 2022
5135da0
fix: Move the _NginxConf parser out of the combiner (#3386)
ryan-blakley Apr 19, 2022
18ef70e
fix: Move _LogRotateConf parser out of combiner (#3389)
ryan-blakley Apr 19, 2022
774f99a
fix: make sure JSONParser is compatible with RawFileProvider (#3390)
xiangce Apr 20, 2022
6479bce
feat: Add new crash_kexec_post_notifiers parser (#3387)
TZ3070 Apr 20, 2022
5c020a4
fix: Multiline quote parsing of httpd conf files (#3392)
ryan-blakley Apr 20, 2022
a6ba7df
Skip malware-detection tests on RHEL6/python2.6 (not supported) (#3382)
mhuth Apr 21, 2022
34d2e75
Feat: Add spec and parser for 'containers_policy' (#3394)
shlao Apr 28, 2022
d3804e7
Fix failing malware-detection tests (#3400)
mhuth May 3, 2022
82c3f64
Add parser bdi_read_ahead_kb for '/sys/class/bdi/*/read_ahead_kb' fil…
JoySnow May 5, 2022
12fac18
Feat: Add spec and parser for 'nginx_log' (#3402)
rahulXs May 6, 2022
bdc3387
feat: RHICOMPL-2450 implemented OpenSCAP result obfuscation (#3349)
skateman May 9, 2022
edc8223
fixes: the last login time is considered as DB query result (#3404)
huali027 May 10, 2022
6d0c422
fix: Deprecation warnings and removal of collections (#3407)
ryan-blakley May 11, 2022
18f65d5
Add parser for /proc/self/mountinfo and new combiner mounts (#3398)
JoySnow May 11, 2022
975be6f
feat: RHEL 8.6 is GA (#3409)
xiangce May 12, 2022
b44e8d5
Move tests in code directories to tests dir (#3261)
bfahr May 13, 2022
fd47df4
Update CI/CD to include Python 3.9 (#3410)
bfahr May 17, 2022
5f2c955
Add os major version 9 for Compliance (#3413)
marleystipich2 May 18, 2022
d89fe6b
fixes: exception with "Reading VG shared_vg1 without a lock" (#3412)
huali027 May 19, 2022
8748fdb
feat: RHEL 9.0 is GA (#3416)
xiangce May 19, 2022
e6b6f61
Handle the value in kernel-alt pkg (#3415)
May 19, 2022
7e5cf31
feat: Add spec and parser for file '/etc/sysconfig/nfs' (#3419)
JoySnow May 25, 2022
773bb3b
feat: New ceph version and enhance (#3422)
xiangce May 26, 2022
e728128
feat: New parser ProcKeys for '/proc/keys' file (#3417)
TZ3070 May 26, 2022
d352e8a
fix(Compliance): Find policy correctly when there is one datasteam fi…
marleystipich2 May 26, 2022
3569c71
feat: Updated the parser to also return allow-recursion content (#3427)
rasrivas-redhat May 31, 2022
6d9c45b
Add Alpha to redhat release detection (#3431)
bfahr May 31, 2022
fa0f4b4
chore: remove the unused get_owner from specs.default (#3429)
xiangce Jun 1, 2022
613cec2
refactor: move the rest of datasource to the datasources dir (#3430)
xiangce Jun 1, 2022
ffdc458
malware-detection feature: handle different yara versions (#3428)
mhuth Jun 2, 2022
b34dc11
feat: New spec and parser for group_info (#3423)
xiangce Jun 2, 2022
2b2c7de
feat: new spec and parser for /etc/sudoers (#3425)
xiangce Jun 2, 2022
77aec44
feat: Add --parallel arg for insights-run (#3418)
ryan-blakley Jun 2, 2022
8b41e0a
Updating sos_archive to parse file for GSS rule (#3432)
mohitkumarrh Jun 2, 2022
7dc4101
feat: New specs for systemd ls output and modification of existing pa…
jobselko Jun 2, 2022
f89003b
feat: Support parallelly running for insights-engine (#3436)
xiangce Jun 8, 2022
c723a5b
feat: Add --no-load-default arg to the insights-run command (#3434)
ryan-blakley Jun 9, 2022
7d7a094
When insights client is killed the directories in /var/tmp are not re…
ahitacat Jun 14, 2022
daf32aa
malware-detection: implement yara version handling differently (#3437)
mhuth Jun 14, 2022
9bc5b49
Append compression type to content-type of MIME. Compare file compres…
ahitacat Jun 15, 2022
1d9fdfb
Mock test creating files in protected directories (#3440)
ahitacat Jun 15, 2022
e90de91
Add new parser for /etc/nfs.conf (#3438)
JoySnow Jun 16, 2022
0878bbe
Fix tests that removing temp archives (#3445)
ahitacat Jun 17, 2022
56d0c19
Update canonical_facts to load needed components (#3444)
bfahr Jun 17, 2022
a70a508
Replace xfail with positive test (#3443)
Glutexo Jun 17, 2022
2647e41
Remove RPM_OUTPUT_SHADOW_UTILS (#3442)
Glutexo Jun 17, 2022
173db55
Update canonical_facts to load needed components (#3448)
bfahr Jun 23, 2022
4180382
Handle downloading malware-detection rules from stage environment (#3…
mhuth Jun 29, 2022
19f437d
feat: Parser for "ls systemd units" (#3451)
jobselko Jun 30, 2022
f5910bc
feat: add "modinfo_filtered_modules" to collect the filtered modules …
huali027 Jun 30, 2022
aa0c992
fixes: Recover "modinfo_xxx" specs (#3456)
huali027 Jul 1, 2022
18a9721
feat: New spec "/etc/lvm/devices/system.devices" and parser (#3457)
huali027 Jul 7, 2022
a7a6f5b
feat: Add combiner "ModulesInfo" (#3458)
huali027 Jul 12, 2022
42af132
fix: Replace non ascii characters with question marks (#3464)
ryan-blakley Jul 13, 2022
ea4e742
fix: Catch any exceptions when scanning for files (#3463)
ryan-blakley Jul 14, 2022
77bf5f6
Feat: Add teamdctl_state_dump spec to insights_archive (#3455)
TZ3070 Jul 14, 2022
921182e
fix: Enhance nmcli (#3465)
TZ3070 Jul 14, 2022
998129a
Fix: test error of nmcli in the datasource ethernet (#3468)
TZ3070 Jul 14, 2022
a32d131
feat: revert and refine the padman list specs and parsers (#3466)
xiangce Jul 14, 2022
600364b
Unregister option removes machine-id (#3449)
ahitacat Jul 14, 2022
5d8ed9f
Add spec and parser for 'wc_-l_.proc.1.mountinfo' (#3459)
JoySnow Jul 14, 2022
7ac38ef
Fix: Restore the spec cni_podman_bridge_conf (#3471)
shlao Jul 21, 2022
81c493e
Fix: Add pre-check for teamdctl_state_dump (#3470)
TZ3070 Jul 21, 2022
fc43819
fix: Add spec "lvmconfig" back (#3474)
huali027 Jul 21, 2022
c88b5c0
fix: Restrict Sphinx's version since it breaks docs build (#3483)
ryan-blakley Jul 26, 2022
af4fe96
Fix error with umask not being restored when dir exists (#3480)
bfahr Jul 27, 2022
42a871f
feat: Add spec for teamdctl_config_dump parser (#3472)
TZ3070 Jul 28, 2022
fdfcc66
fix: the parser "LvmConfig" raises exception (#3476)
huali027 Jul 28, 2022
23d0584
Add new system_user_dirs datasource and parser (#3381)
jobselko Jul 29, 2022
c2298ec
Update the marker for MustGatherContext (#3479)
shzhou12 Aug 1, 2022
ea9dc17
Add missing datasource docs to build (#3487)
bfahr Aug 1, 2022
38c3878
New version of flake8 found some errors (#3488)
bfahr Aug 1, 2022
ba07498
fix: Update aws specs to use IMDSv2 (#3486)
bfahr Aug 3, 2022
77f0196
Feat: Add new parser sys_fs_cgroup_memory_tasks_number (#3467)
wushiqinlou Aug 4, 2022
05459e0
feat: Add version to deprecated function (#3491)
ryan-blakley Aug 9, 2022
030176a
Automatically retry malware-detection downloads & uploads (#3493)
mhuth Aug 17, 2022
1547559
Feat: New grub2_editenv_list parser (#3481)
TZ3070 Aug 18, 2022
00566b0
feat: New spec and parser for"auditctl -l" (#3496)
huali027 Aug 18, 2022
ed8f91d
New location for temp directory and tests (#3489)
ahitacat Aug 18, 2022
2eb0fb5
Add release timeline (#3500)
Aug 25, 2022
103f84c
feat: New spec and parser for `authselect current` (#3490)
xiangce Aug 25, 2022
3d8ae09
Feat: New parser for 'ls -lanL /etc/ssh' command (#3499)
TZ3070 Aug 25, 2022
9389cb4
feat: New spec and parser to get the satellite provision params (#3501)
huali027 Aug 25, 2022
43e6f52
Feat: New journal_header (#3498)
TZ3070 Aug 25, 2022
41f9c35
fix: Issue calling collect from cli (#3506)
bfahr Aug 30, 2022
26d6155
fix: Revert the httpd_on_nfs datasource spec (#3509)
xiangce Sep 1, 2022
f890e65
fix: change cloud_cfg to Yaml and modify the source spec (#3484)
xiangce Sep 1, 2022
860c098
Fix: grubenv cannot be collected when error shown in output (#3511)
TZ3070 Sep 1, 2022
e56f7a6
Added no_proxy autoconfiguration from rhsm conf and tests (#3507)
ahitacat Sep 1, 2022
bf77042
Ensure full path when using timeout command (#3508)
bfahr Sep 8, 2022
92dec74
Feat: add secure spec to default.py (#3513)
TZ3070 Sep 8, 2022
faa3b9b
fix: support InstanceType in saphostctrl (#3512)
xiangce Sep 8, 2022
e4886d3
feat: Update ls_systemd_units parser (#3518)
jobselko Sep 13, 2022
fd368b5
Refractor cleanup local files for unregistration processes (#3520)
ahitacat Sep 13, 2022
b80d650
feat: Add spec "satellite_enabled_features" back (#3517)
huali027 Sep 15, 2022
f5480dd
Feat: Add spec and parser for cryptsetup luksDump (#3504)
danzatt Sep 15, 2022
73a472c
New parser for CpuSMTControl and tests update (#3521)
jobselko Sep 15, 2022
f998e23
feat: New spec to get satellite logs table size and its parser (#3516)
huali027 Sep 15, 2022
a316c02
fix: Removing extraneous space inserted in commit 894484a (#3523)
mike-kingsbury Sep 19, 2022
eb852e1
fix: Soscleaner fix (#3502)
Glutexo Sep 19, 2022
ecc5475
fix: bz-2126966: use SIGTERM for rpm instead of SIGKILL (#3524)
xiangce Sep 20, 2022
20816be
feat: Add combiner rhel for edge (#3526)
wushiqinlou Sep 22, 2022
8485052
feat: New spec "/etc/cron.d/foreman" and parser (#3514)
huali027 Sep 22, 2022
6732c34
Update docstring to make it more readable (#3531)
Sep 27, 2022
0c0a551
fix: bz-2130242, remove the print statement (#3535)
xiangce Sep 29, 2022
8ecdfe8
feat: [PoC] Support Container Specs (#3477)
xiangce Sep 29, 2022
a186edf
refactor: Keep the raw line for rule use (#3533)
huali027 Sep 29, 2022
1c53b43
fix: make SAPHostCtrlInstances compatible with old archives (#3528)
xiangce Sep 29, 2022
b32627b
Fix registration tests (#3519)
ahitacat Oct 3, 2022
777bbd9
feat: add helper function: get_dependency_specs and test (#3534)
xiangce Oct 6, 2022
0466219
Add spec and parser for luksmeta command (#3525)
danzatt Oct 13, 2022
6e3bc3f
fix: Restore the spec ovs_appctl_fdb_show_bridge (#3538)
Oct 13, 2022
b495112
chore: remove the unused specs (#3537)
xiangce Oct 13, 2022
d11ac70
Deprecate insights.core.scannable & engine_log parser (#3541)
Oct 13, 2022
43cc5e8
Feat: New parser for the "ls -lan /var/lib/sss/pubconf/krb5.include.d…
rasrivas-redhat Oct 13, 2022
d46110f
Remove authselect_current from core collection (#3552)
xiangce Oct 13, 2022
0bc7711
refactor: remove duplicated specs from get_dependency_specs (#3549)
xiangce Oct 13, 2022
13e06fa
fix: Add ability to return exceptions during insights collect (#3539)
vdymna Oct 13, 2022
03c8b83
Removed assert of virt-who, it is not in uploader.json (#3556)
ahitacat Oct 18, 2022
f25b797
[New-parser] parser_mpirun_version (#3542)
mohitkumarrh Oct 18, 2022
3164d83
feat: New spec "semanage login -l" and parser (#3548)
huali027 Oct 20, 2022
a29cc4e
fix: let container_execute to support rpm_format of installed_rpms (#…
xiangce Oct 24, 2022
c4e809b
Handle upload exceptions allowing --retries to work properly (#3558)
mhuth Oct 25, 2022
d36f63d
feat: New Parser for container_installed_rpms (#3560)
TZ3070 Oct 26, 2022
9968384
Order specs by alphabetical order (#3564)
ryan-blakley Oct 27, 2022
7725bde
test: add test for existing container specs (#3563)
xiangce Oct 27, 2022
06146b1
enhance and fix for softnet_data parser (#3561)
remijouannet Oct 27, 2022
4978b75
Avoid test to write in disk if machine-id is not found (#3543)
ahitacat Oct 27, 2022
1ad0bd6
fix: remove duplicated containers from running_rhel_containers (#3571)
xiangce Oct 28, 2022
d61496e
fix: missing call to a RPM format generation function (#3572)
danzatt Oct 31, 2022
d887994
enhance: add base class 'OVSvsctlList' (#3575)
shlao Nov 1, 2022
e1d279e
feat: new spec and parser for 'subscription-manage facts' (#3555)
xiangce Nov 3, 2022
397534e
fix: LuksDump not parsing multiple data segments (#3569)
danzatt Nov 3, 2022
0f50d36
fix: check list range to avoid exception (#3576)
takayuki-nagata Nov 3, 2022
020dc42
chore: remove the unused 'ethernet_interfaces' spec (#3577)
xiangce Nov 3, 2022
1878a29
fix: remove the inner functions of the _make_rpm_formatter (#3574)
xiangce Nov 3, 2022
969c407
feat: Add parser container_inspect (#3562)
wushiqinlou Nov 3, 2022
154438d
feat: new spec and parser for 'azure_instance_id' (#3568)
xiangce Nov 3, 2022
93e3ec5
feat(client): add --manifest argument (#3547)
subpop Nov 3, 2022
90a44a6
fix(parsers): add support for missing logs (#3582)
subpop Nov 4, 2022
ccbb62f
Update github actions to use latest version (#3583)
bfahr Nov 4, 2022
a343a9d
fix: values of broker.tracebacks should be string (#3579)
xiangce Nov 8, 2022
d6c06bc
feat: New spec "/etc/fapolicyd/rules.d/*.rules" and parser (#3587)
huali027 Nov 9, 2022
f610348
feat: New Combiner CloudInstance (#3585)
xiangce Nov 9, 2022
3ef1b48
Feat: New Parser for 'dotnet --version' Command for Containers (#3581)
TZ3070 Nov 9, 2022
00fcbe3
Handle network exceptions when accessing egg URL (#3588)
mhuth Nov 10, 2022
90a9a41
Update system_user_dirs datasource (#3586)
jobselko Nov 10, 2022
3436d87
Registration check unregisters when it is not connected (#3540)
ahitacat Nov 10, 2022
f849aa7
Add rhel 8.7 into uname.py (#3591)
chenlizhong Nov 11, 2022
968b104
feat: Add timeout to datasources (#3573)
ryan-blakley Nov 15, 2022
f812c0f
Revert "feat: Add timeout to datasources (#3573)" (#3594)
ryan-blakley Nov 16, 2022
3f6d9a9
Fix: Update container_installed_rpms spec (#3589)
TZ3070 Nov 16, 2022
67c00de
[New Specs] ls_var_lib_pcp (#3590)
mohitkumarrh Nov 17, 2022
3650732
Rename system_user_dirs to rpm_pkgs (#3597)
jobselko Nov 17, 2022
2b89974
feat: New spec "timedatectl" and the parser (#3592)
huali027 Nov 21, 2022
b2dc682
feat: RHEL 9.1 is GA (#3599)
xiangce Nov 21, 2022
53a3b01
New specs var_log_pcp_openmetrics_log (#3596)
mohitkumarrh Nov 22, 2022
62ff8f5
Rename downloaded temp malware rules file (#3602)
mhuth Nov 23, 2022
c7feb72
test: use ubuntu 20.04 instead of latest as the issue in latest (#3608)
chenlizhong Nov 25, 2022
ec9aff2
Don't look for yara installed in /usr/local/bin (#3614)
mhuth Nov 28, 2022
c208f45
[insights-core-3.0.300] Remove deprecated features (#3595)
Nov 29, 2022
dda5fd2
Add datasource to get jboss versions (#3600)
chenlizhong Nov 29, 2022
7f6f203
fix: Update the pinned doc modules (#3615)
ryan-blakley Nov 29, 2022
844f31f
Add nginx error log which is installed from RHSCL (#3616)
huali027 Nov 30, 2022
4b8f720
Display message when malware scan_timeout aborts scan (#3617)
mhuth Nov 30, 2022
4d3a4a0
feat: Add timeout to datasources (#3598)
ryan-blakley Dec 1, 2022
dc3e5dc
fix: add deprecated warning message in insights.combiners.mounts (#3613)
chenlizhong Dec 1, 2022
7cb5088
Keep the code to delete previously-named malware rules file (#3619)
mhuth Dec 1, 2022
bb032fb
fix: fix errors in ethtool (#3605)
chenlizhong Dec 1, 2022
0e263a5
Feat register no machine-id (#3554)
ahitacat Dec 5, 2022
5438a4d
feat: New spec "ls -lZ /var/lib/rsyslog" and the parser (#3618)
huali027 Dec 7, 2022
a0c7260
feat: Add container spec sys_cpu_online (#3612)
wushiqinlou Dec 7, 2022
eafa97a
feat: Add spec container_nginx_error_log (#3607)
wushiqinlou Dec 7, 2022
47762f5
feat: Add spec sys_cpuset_cpus (#3611)
wushiqinlou Dec 7, 2022
b81e677
Remove usage of reregistration and deprecate cli-option (#3522)
ahitacat Dec 7, 2022
63cd46c
Feat: Add Parser LsinitrdKdumpImage (#3567)
TZ3070 Dec 8, 2022
a4afe50
fix: fix CI issue when preparing py26 env (#3624)
xiangce Dec 8, 2022
9d72856
Delete old malware rules files from /var/tmp as well (#3625)
mhuth Dec 13, 2022
21295cd
fix: Log brief msg instead of Traceback when cmd not found (#3628)
xiangce Dec 14, 2022
e61b8f4
Improve old Python compatibility by not requiring ipython 8.6.0. (#3630)
jsvob Dec 15, 2022
357c365
Fix: fix GrubbyDefaultKernel cannot handle specific invalid content (…
TZ3070 Dec 15, 2022
abd3204
fix: py26 CI not found 'Python.h' (#3642)
xiangce Dec 23, 2022
492335c
fix: Convert aws_token to string since sometimes it's unicode (#3643)
huali027 Dec 23, 2022
f5fb6aa
Rework toposort algorithm as an ancestor traversal
PaulWay Jan 4, 2023
bdd1abc
Yield empty set and raise StopIteration on empty input
PaulWay Jan 5, 2023
3f8bb37
Cast keys to set if Python v2
PaulWay Jan 5, 2023
f273a52
Cope with Python 2.6 using version_info as tuple not named tuple
PaulWay Jan 5, 2023
bfe8eb1
Grab major version for python 2.6 (oops)
PaulWay Jan 5, 2023
eddbf68
feat: Add env override to CommandOutputProvider (#3636)
ryan-blakley Jan 10, 2023
f815c41
Create timeout signal for hostcontext only (#3647)
lhuett Jan 10, 2023
f5a8eef
Allow callers to order components for execution. (#3649)
csams Jan 11, 2023
17f13d1
Move exceptions to their own module file (#3622)
ryan-blakley Jan 11, 2023
ed29640
Fix: Add condition to check the output of "rpm-ostree status" firstly…
wushiqinlou Jan 12, 2023
27bf5fe
fix: Do not log Parsers' Traceback during collection (#3633)
xiangce Jan 12, 2023
1b3643d
feat: New datasource "sys_fs_cgroup_uniq_memory_swappiness" and its p…
qinpingli Jan 12, 2023
7dd60bb
feat: new combiner OSRelease to identify RHEL (#3640)
xiangce Jan 12, 2023
5b9b493
Revert "Fix: Add condition to check the output of "rpm-ostree status"…
xiangce Jan 12, 2023
825e9b2
Merge branch 'master' into paulway_improve_topological_sort
PaulWay Jan 12, 2023
4b36ec4
add specs (datasource via insights-cat) required by CloudInstance (#3…
xiangce Jan 17, 2023
dab803b
Fix: write all getting data to sys_fs_cgroup_uniq_memory_swappiness (…
qinpingli Jan 18, 2023
613aeca
fix: check the content first in class InstalledRpms (#3651)
chenlizhong Jan 18, 2023
42dc3ec
Fix: Add condition to check the output of "rpm-ostree status" firstl…
wushiqinlou Jan 18, 2023
c6aaf6a
Merge branch 'master' into paulway_improve_topological_sort
PaulWay Jan 18, 2023
d6f13f5
Move remaining exceptions to the new exceptions module (#3656)
ryan-blakley Jan 19, 2023
39ababc
feat: add JbossRuntimeVersions parser (#3639)
chenlizhong Jan 19, 2023
5d0ac7d
fix: add '-d 2' to yum_repolist spec (#3660)
xiangce Jan 19, 2023
078ba67
Exclude malware-detection rules files in /var/tmp (and other location…
mhuth Jan 25, 2023
cc02932
Make malware-detection app more resilient to unexpected errors (#3661)
mhuth Jan 31, 2023
c35bbd1
Disable datasource timeout alarm for the malware-detection app (#3666)
mhuth Jan 31, 2023
b43d87c
fix: Resolve VDOStatus excessive ParseException (#3668)
JoySnow Jan 31, 2023
75e437e
feat: Add arg to capture skips in the broker (#3663)
ryan-blakley Jan 31, 2023
dc79de0
Deprecate SkipException to help avoid confusion (#3662)
ryan-blakley Feb 2, 2023
97b47dd
feat: add CloudInstance to canonical_facts (#3654)
xiangce Feb 2, 2023
3cfcfc1
fix: use LC_ALL=C.UTF-8 for subscription-manager (#3669)
ptoscano Feb 2, 2023
f5a6f32
fix: Enhance datasource kernel_module_filters to check the loaded mod…
wushiqinlou Feb 2, 2023
b062e58
Change sos archive lvm spec names (#3672)
ryan-blakley Feb 6, 2023
5ec5c3a
feat: Capture blacklisted specs inside archive (#3664)
ryan-blakley Feb 6, 2023
d3542c2
Merge branch 'master' into paulway_improve_topological_sort
PaulWay Feb 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New location for temp directory and tests (#3489)
Signed-off-by: ahitacat <ahitacat@redhat.com>
ahitacat authored Aug 18, 2022
commit ed8f91da5f962ae3e81094d4b6cfb60d67999d55
10 changes: 7 additions & 3 deletions insights/client/archive.py
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

from .utilities import determine_hostname, _expand_paths, write_data_to_file
from .insights_spec import InsightsFile, InsightsCommand
from .constants import InsightsConstants as constants

logger = logging.getLogger(__name__)

@@ -42,11 +43,13 @@ def __init__(self, config):
"""
self.config = config
self.cleanup_previous_archive()
if not os.path.exists(constants.insights_tmp_path):
os.mkdir(constants.insights_tmp_path, 0o700)
# input this to core collector as `tmp_path`
self.tmp_dir = tempfile.mkdtemp(dir='/var/tmp/', prefix='insights-archive-')
self.tmp_dir = tempfile.mkdtemp(dir=constants.insights_tmp_path, prefix='insights-archive-')

# we don't really need this anymore...
self.archive_tmp_dir = tempfile.mkdtemp(dir='/var/tmp/', prefix='insights-archive-')
self.archive_tmp_dir = tempfile.mkdtemp(dir=constants.insights_tmp_path, prefix='insights-archive-')

# We should not hint the hostname in the archive if it has to be obfuscated
if config.obfuscate_hostname:
@@ -250,7 +253,8 @@ def cleanup_previous_archive(self):
'''
Used at the start, this will clean the temporary directory of previous killed runs
'''
for file in glob.glob('/var/tmp/insights-archive-*'):
archive_glob = os.path.join(constants.insights_tmp_path, 'insights-archive-*')
for file in glob.glob(archive_glob):
os.path.join('', file)
logger.debug("Deleting previous archive %s", file)
shutil.rmtree(file, True)
3 changes: 2 additions & 1 deletion insights/client/constants.py
Original file line number Diff line number Diff line change
@@ -78,7 +78,8 @@ class InsightsConstants(object):
sig_kill_bad = 101
cached_branch_info = os.path.join(default_conf_dir, '.branch_info')
pidfile = os.path.join(os.sep, 'var', 'run', 'insights-client.pid')
egg_release_file = os.path.join(os.sep, 'var', 'tmp', 'insights-client', 'insights-client-egg-release')
insights_tmp_path = os.path.join(os.sep, 'var', 'tmp', 'insights-client')
egg_release_file = os.path.join(insights_tmp_path, 'insights-client-egg-release')
ppidfile = os.path.join(os.sep, 'tmp', 'insights-client.ppid')
valid_compressors = ("gz", "xz", "bz2", "none")
# RPM version in which core collection was released
62 changes: 42 additions & 20 deletions insights/tests/client/test_archive.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from os.path import join as path_join
from insights.client.archive import InsightsArchive
from mock.mock import patch, Mock, call
from unittest import TestCase
from pytest import raises
from insights.client.constants import InsightsConstants as constants

test_timestamp = '000000'
test_hostname = 'testhostname'
@@ -34,11 +36,21 @@ def test_init_archive(self, cleanup, register, mkdtemp):
assert archive.archive_name == test_archive_name

cleanup.assert_called_once()
mkdtemp.assert_has_calls([call(dir='/var/tmp/', prefix='insights-archive-')])
mkdtemp.assert_has_calls([call(dir=constants.insights_tmp_path, prefix='insights-archive-')])
register.assert_called_once()

@patch('insights.client.archive.os.mkdir')
@patch('insights.client.archive.os.path.exists', return_value=False)
def test_create_tmp_dir(self, exists, mkdir, _, __):
'''
Verify temporary directory insights_tmp_path is created if it does not exists
'''
config = Mock()
InsightsArchive(config)
mkdir.assert_has_calls([call(constants.insights_tmp_path, 0o700)])

@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', Mock(return_value=False))
@patch('insights.client.archive.os.path.exists', Mock(side_effect=[True, False]))
def test_create_archive_dir_default(self, makedirs, _, __):
'''
Verify archive_dir is created when it does not already exist
@@ -61,28 +73,32 @@ def test_create_archive_dir_default(self, makedirs, _, __):
@patch('insights.client.archive.shutil.rmtree')
def test_tmp_directory_no_cleanup(self, rmtree, glob, _, __):
InsightsArchive(Mock())
glob.assert_called_with('/var/tmp/insights-archive-*')
glob_path = path_join(constants.insights_tmp_path, 'insights-archive-*')
glob.assert_called_once_with(glob_path)
rmtree.assert_not_called()

@patch('insights.client.archive.glob.glob', return_value=[test_tmp_dir])
@patch('insights.client.archive.shutil.rmtree')
def test_tmp_directory_cleanup(self, rmtree, glob, _, __):
InsightsArchive(Mock())
glob.assert_called_with('/var/tmp/insights-archive-*')
glob_path = path_join(constants.insights_tmp_path, 'insights-archive-*')
glob.assert_called_once_with(glob_path)
rmtree.assert_called_with(test_tmp_dir, True)

@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', Mock(return_value=False))
def test_create_archive_dir_obfuscated(self, makedirs, _, __):
'''
Verify archive_dir is created when it does not already exist
'''
config = Mock()
config.obfuscate_hostname = True
archive = InsightsArchive(config)
with patch('insights.client.archive.os.path.exists', return_value=True):
archive = InsightsArchive(config)
# give this a discrete value so we can check the results
archive.tmp_dir = '/var/tmp/test'
result = archive.create_archive_dir()

with patch('insights.client.archive.os.path.exists', return_value=False):
result = archive.create_archive_dir()
makedirs.assert_called_once_with(test_obfuscated_archive_dir, 0o700)
# ensure the archive_dir is returned from the function
assert result == test_obfuscated_archive_dir
@@ -92,7 +108,7 @@ def test_create_archive_dir_obfuscated(self, makedirs, _, __):
assert result == archive.archive_dir

@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', return_value=False)
@patch('insights.client.archive.os.path.exists', side_effect=[True, False, False])
def test_create_archive_dir_defined_path_DNE(self, exists, makedirs, _, __):
'''
Verify archive_dir is created when the attr is defined but
@@ -116,18 +132,19 @@ def test_create_archive_dir_defined_path_DNE(self, exists, makedirs, _, __):
assert result == archive.archive_dir

@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', return_value=True)
def test_create_archive_dir_undef_path_exists(self, exists, makedirs, _, __):
def test_create_archive_dir_undef_path_exists(self, makedirs, _, __):
'''
Verify archive_dir is not re-created when the attr is undefined but
the path exists
'''
config = Mock()
config.obfuscate_hostname = False
archive = InsightsArchive(config)
with patch('insights.client.archive.os.path.exists', return_value=True):
archive = InsightsArchive(config)
# give this a discrete value so we can check the results
archive.tmp_dir = '/var/tmp/test'
result = archive.create_archive_dir()
with patch('insights.client.archive.os.path.exists', return_value=True) as exists:
result = archive.create_archive_dir()
makedirs.assert_not_called()
exists.assert_called_once_with(test_archive_dir)
# ensure the archive_dir is returned from the function
@@ -138,17 +155,18 @@ def test_create_archive_dir_undef_path_exists(self, exists, makedirs, _, __):
assert result == archive.archive_dir

@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', return_value=True)
def test_create_archive_dir_defined_path_exists(self, exists, makedirs, _, __):
def test_create_archive_dir_defined_path_exists(self, makedirs, _, __):
'''
When archive_dir is defined and exists, simply return the
class attr and do not attempt to create it
'''
archive = InsightsArchive(Mock())
with patch('insights.client.archive.os.path.exists', return_value=True):
archive = InsightsArchive(Mock())
# give this a discrete value so we can check the results
archive.tmp_dir = '/var/tmp/test'
archive.archive_dir = test_archive_dir
result = archive.create_archive_dir()
with patch('insights.client.archive.os.path.exists', return_value=True) as exists:
result = archive.create_archive_dir()
makedirs.assert_not_called()
exists.assert_called_once_with(archive.archive_dir)
# ensure the archive_dir is returned from the function
@@ -160,7 +178,7 @@ class attr and do not attempt to create it

@patch('insights.client.archive.InsightsArchive.create_archive_dir', return_value=test_archive_dir)
@patch('insights.client.archive.os.makedirs')
@patch('insights.client.archive.os.path.exists', return_value=False)
@patch('insights.client.archive.os.path.exists', side_effect=[True, False])
def test_create_command_dir(self, exists, makedirs, create_archive_dir, _, __):
'''
Verify insights_commands dir is created
@@ -179,7 +197,8 @@ def test_create_command_dir(self, exists, makedirs, create_archive_dir, _, __):

@patch('insights.client.archive.InsightsArchive.create_archive_dir', return_value=test_archive_dir)
@patch('insights.client.archive.os.path.join', Mock())
def test_get_full_archive_path(self, create_archive_dir, _, __):
@patch('insights.client.archive.InsightsArchive.cleanup_previous_archive')
def test_get_full_archive_path(self, create_archive_dir, cleanup, _, __):
'''
Verify create_archive_dir is called when calling get_full_archive_path
'''
@@ -191,6 +210,7 @@ def test_get_full_archive_path(self, create_archive_dir, _, __):
@patch('insights.client.archive.os.path.join', Mock())
@patch('insights.client.archive.os.path.isdir', Mock())
@patch('insights.client.archive.shutil.copytree', Mock())
@patch('insights.client.archive.InsightsArchive.cleanup_previous_archive', Mock())
def test_copy_dir(self, create_archive_dir, _, __):
'''
Verify create_archive_dir is called when calling copy_dir
@@ -215,6 +235,7 @@ def test_keep_archive(self, path_exists, copyfile, _, __):
@patch('insights.client.archive.os.path.basename', Mock())
@patch('insights.client.archive.logger')
@patch('insights.client.archive.os.path.exists', return_value=True)
@patch('insights.client.archive.InsightsArchive.cleanup_previous_archive', Mock())
def test_keep_archive_err_during_copy(self, path_exists, logger, copyfile, _, __):
archive = InsightsArchive(Mock())
archive.archive_stored = '/var/tmp/test-archive/test-store-archive'
@@ -224,14 +245,15 @@ def test_keep_archive_err_during_copy(self, path_exists, logger, copyfile, _, __
logger.error.assert_called_once_with('ERROR: Could not stored archive to %s', archive.archive_stored)

@patch('insights.client.archive.os.makedirs', side_effect=OSError)
@patch('insights.client.archive.os.path.exists', return_value=False)
@patch('insights.client.archive.os.path.exists', side_effect=[True, False])
@patch('insights.client.archive.os.path.join', Mock())
@patch('insights.client.archive.os.path.isdir', Mock())
@patch('insights.client.archive.os.path.basename', Mock())
@patch('insights.client.archive.logger')
@patch('insights.client.archive.InsightsArchive.cleanup_previous_archive', Mock())
def test_keep_arhive_err_creating_directory(self, logger, path_exists, mkdir, _, __):
archive = InsightsArchive(Mock())
archive.keep_archive_dir = '/var/tmp/test-archive'
with raises(Exception):
archive.storing_archive()
logger.error.assert_called_once_with('ERROR: Could not create %s', archive.keep_archive_dir)
logger.error.assert_called_with('ERROR: Could not create %s', archive.keep_archive_dir)