Recently I needed to run a bunch of osm2pgsql tests in a virtual machine, so optimized the process. You would not normally do development in a VM, but it’s useful for testing. It’s particularly useful for me because my old Ubuntu server uses a development version of PostGIS which doesn’t work with the testsuite.
I was using VirtualBox to run the VMs, and started with a base Ubuntu 14.04 server install on a virtual drive of at least 30GB. The flat-nodes tests require a lot of space.
Starting with the base, I updated the OS with
1
|
|
This gave me a VM I could clone and use for other projects. Starting from a cloned VM, I installed the dependencies. Copying and pasting into VirtualBox can be a pain, so a bit of clever shell expansion minimizes the text I need to type
1 2 3 |
|
The osm2pgsql testsuite requires a custom tablespace for some of the tests, as well as normal PostgreSQL setup.
1 2 3 4 |
|
To get osm2pgsql, I was cloning my own git repo instead of the normal one, but if you wanted to get the source, build the latest version, and run the testsuite, I did it with
1 2 3 4 5 6 |
|