taskotron / fake-fedorainfra

Created 5 years ago
Maintained by kparal
ARCHIVED: mock Fedora Infra project to test Taskotron functionality
Members 2


This project has been deprecated when Fedora switched to using Bodhi2 (and respective python-fedora package update), which requires OpenID authentication before performing write operations (submitting comments). Only query operations are currently supported by fake_fedorainfra with Bodhi2. We're trying to get away from submitting Bodhi comments in general, so fixing this library was not deemed worth the time. This project might be revived in the future if new Bodhi2 mocking needs arise or we need to mock other services (e.g. Koji).


A simple webapp which will allow to mock Fedora Bodhi for comment submit requests. Mostly to be used together with libtaskotron.

All Bodhi list (query) operations are forwarded to real Bodhi and the result is passed back. The post comment operation is saved to a local database and not forwarded to the official instance.

Quick development setup

If you want to be able to quickly use fake_fedorainfra for development purposes, follow these steps:

$ virtualenv env_fakefedorainfra
$ source env_fakefedorainfra/bin/activate
$ pip install -r requirements.txt
$ DEV=true ./init_db.sh
$ DEV=true python runapp.py

The app frontend is running at http://localhost:5000/boji, you can see all locally stored comments there. The real Bodhi-like interface is running at http://localhost:5000/bodhi, for example you can try http://localhost:5000/bodhi/list - that requests a list of most recent Bodhi updates, and this request should be redirected to the official Fedora Bodhi instance. Any comment submit requests should be kept inside fake_fedorainfra, though. All comments are stored inside /var/tmp/fake_fedorainfra_db.sqlite.

Adjusting configuration

You can configure this app by copying conf/settings.py.example into conf/setting.py and adjusting values as you see fit. It overrides default values in fake_fedorainfra/config.py.

Using with libtaskotron

You might want to use this tool together with libtaskotron. You need to configure libtaskotron to use fake_fedorainfra instead of real Bodhi. Edit /etc/taskotron/taskotron.yaml and set the following value:

bodhi_server: http://localhost:5000/bodhi

You might also need to adjust reporting_enabled and report_to_bodhi, depending on your local settings.

If you don't have fas_username and fas_password filled out, you'll need to do so (any value).

Running test suite

You can run this test suite with the following command:

$ py.test --functional testing/