Skip to content

Instantly share code, notes, and snippets.

@smcv
Last active August 29, 2015 13:56
Show Gist options
  • Save smcv/9072796 to your computer and use it in GitHub Desktop.
Save smcv/9072796 to your computer and use it in GitHub Desktop.
making open-build-service able to run its tests

Getting enough OBS to run regression tests

  • Download http://download.opensuse.org/repositories/OBS:/Server:/Unstable/images/iso/obs-server.x86_64.install.iso (at the time I tried it was obs-server.x86_64-2.4.51-Build8.12.install.iso)

  • Create a virtual machine. I used virt-manager with the qemu (kvm) backend, 2048M RAM, 2 (out of 4) CPU cores, installing from the .iso to a 120GB qcow2 virtual disk - at the time of writing it needs to be at least 100GB for the appliance's automatic disk resizing logic to work properly.

  • At the GRUB menu choose "Install_OBS_Server"

  • Say "yes" to overwriting the virtual disk vda

  • Let it reboot into the on-disk OS

  • Log in on the console: root/opensuse

  • hostnamectl set-hostname obs.virt (or whatever), otherwise the appliance defaults to "linux"

  • systemctl reboot

  • log in on the console again

    • zypper refresh
    • zypper dup
    • systemctl enable sshd
    • systemctl start sshd
    • useradd -m myuser
    • passwd myuser
    • zypper in sudo
    • zypper in obs-api-testsuite-deps
  • configure your host machine's name resolution or /etc/hosts so obs.virt and obs both resolve to the VM

  • log in via ssh as myuser

  • git clone https://github.com/openSUSE/open-build-service

  • cd ~/open-build-service

    • git submodule init
    • git submodule update
  • cd ~/open-build-service/src/api/

    • cp config/database.yml.example config/database.yml (this assumes the default root password "opensuse")
    • cp config/options.yml.example config/options.yml
    • RAILS_ENV=development rake db:create
    • RAILS_ENV=development rake db:setup
    • RAILS_ENV=test rake db:create
    • RAILS_ENV=test rake db:setup
    • rake test:api
    • To reset the test database you can do:
      • RAILS_ENV=test rake db:drop
      • RAILS_ENV=test rake db:create
      • RAILS_ENV=test rake db:setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment