Writing Python unit tests for HTTP Clients

I have a nagios / icinga HTTP monitor based on PyCurl: check_pycurl3. Writing tests for this is difficult because: So with a little StackExchange googling, you can start Flask in a thread (remember to set daemon=True) like below: You also need to give it some time to start up before tests commence, I’ve used the …

Continue reading ‘Writing Python unit tests for HTTP Clients’ »

dnf upgrade crashing on free oracle cloud vms running OEL8

There are 2 reasons for this: the memory on these VMs is small (668MB) & DNF is badly written and uses 100s of MBs. Secondly Oracle Linux includes a lot of repos. 1. install microdnf by wgetting it (as dnf is failing) wget https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/libpeas-1.22.0-6.el8.x86_64.rpm wget https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/microdnf-3.4.0-4.el8.x86_64.rpm rpm -ivh *.rpm 2. Upgrade base repos microdnf update …

Continue reading ‘dnf upgrade crashing on free oracle cloud vms running OEL8’ »