Last active
July 7, 2017 17:15
-
-
Save nand0p/5e3a1aa14bef381b7215e160e1b92fd4 to your computer and use it in GitHub Desktop.
buildbot-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test ensures buildbot master comes up correctly and workers can connect | |
import ./make-test.nix ({ pkgs, ... } : { | |
name = "buildbot"; | |
nodes = { | |
bbmaster = { config, pkgs, ... }: { | |
services.buildbot-master = { | |
enable = true; | |
package = pkgs.buildbot-full; | |
# NOTE: use fake repo due to no internet in hydra ci | |
factorySteps = [ | |
"steps.Git(repourl='git://gitrepo/fakerepo.git', mode='incremental')" | |
"steps.ShellCommand(command=['bash', 'fakerepo.sh'])" | |
]; | |
changeSource = [ | |
"changes.GitPoller('git://gitrepo/fakerepo.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)" | |
]; | |
}; | |
networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ]; | |
environment.systemPackages = with pkgs; [ git buildbot-full ]; | |
}; | |
... ... | |
testScript = '' | |
#Start up and populate fake repo | |
$gitrepo->waitForUnit("multi-user.target"); | |
print($gitrepo->execute(" \ | |
git config --global user.name 'Nobody Fakeuser' && \ | |
git config --global user.email 'nobody\@fakerepo.com' && \ | |
rm -rvf /srv/repos/fakerepo.git /tmp/fakerepo && \ | |
mkdir -pv /srv/repos/fakerepo ~/.ssh && \ | |
ssh-keyscan -H gitrepo > ~/.ssh/known_hosts && \ | |
cat ~/.ssh/known_hosts && \ | |
cd /srv/repos/fakerepo && \ | |
git init && \ | |
echo -e '#!/bin/sh\necho fakerepo' > fakerepo.sh && \ | |
cat fakerepo.sh && \ | |
touch .git/git-daemon-export-ok && \ | |
git add fakerepo.sh .git/git-daemon-export-ok && \ | |
git commit -m fakerepo && \ | |
git daemon --verbose --export-all --base-path=/srv/repos --reuseaddr & \ | |
")); | |
''; | |
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ nand0p ]; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment