Mock API in (docker) container?

jhollowe

Member
Apr 22, 2020
15
6
8
27
I would like to be able to run some tests against the API for PVE (and PMG and PBS) but I don't want to have an entire instance of PVE installed. I know PVE needs its own kernel to work correctly (which cannot be guaranteed in a container) but I am not sure how much functionality is dependent on it.

Really, what I am looking for is a mock API that I can run in a container. I could then spin this up in my CI and test against the API without actually having anything happen (no VM/CT created, storage changed, etc.).

Would it be possible to chop out parts of PVE to a minimal version that would work with a standard debian (ubuntu) kernel within a container? Or take the existing API code and create a mock API from it?
 
the kernel is mainly needed for three things
- proper namespace and apparmor support for containers
- ZFS
- various tunings and cherry-picks

IMHO mocking the API in a meaningful fashion would be a lot of work (that would need to keep up with developments on our end). probably just taking the API schema and spinning up an endpoint that replies OK to every request that passes the schema checks could work, but that would not give you much more than you can already get from just looking at the API dump..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!