summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/buildbot/master.nix14
-rw-r--r--krebs/3modules/buildbot/slave.nix1
-rw-r--r--krebs/5pkgs/default.nix4
-rw-r--r--krebs/5pkgs/test/infest-cac-centos7/default.nix (renamed from krebs/5pkgs/krebs-ci/default.nix)10
-rwxr-xr-xkrebs/5pkgs/test/infest-cac-centos7/notes (renamed from krebs/5pkgs/krebs-ci/notes)11
5 files changed, 28 insertions, 12 deletions
diff --git a/krebs/3modules/buildbot/master.nix b/krebs/3modules/buildbot/master.nix
index 0d9c53977..19aecead1 100644
--- a/krebs/3modules/buildbot/master.nix
+++ b/krebs/3modules/buildbot/master.nix
@@ -67,8 +67,8 @@ let
s.addStep(grab_repo)
# the dependencies which are used by the test script
- deps = [ "gnumake", "jq", "(import <stockholm> {}).pkgs.krebs-ci" ]
- nixshell = ["nix-shell", "-I", ".", "-p" ] + deps + [ "--run" ]
+ deps = [ "gnumake", "jq", "(import <stockholm> {}).pkgs.test.infest-cac-centos7" ]
+ nixshell = ["nix-shell", "-I", "stockholm=.", "-p" ] + deps + [ "--run" ]
def addShell(f,**kwargs):
f.addStep(steps.ShellCommand(**kwargs))
@@ -95,8 +95,13 @@ let
s.addStep(steps.FileDownload(mastersrc="${cfg.workDir}/{}".format(file),
slavedest=file))
+<<<<<<< HEAD
+ addShell(s,name="infest-cac-centos7",env={"LOGNAME": "shared"},
+ command=nixshell + ["infest-cac-centos7"])
+=======
addShell(s,name="complete-build-centos7",env={"LOGNAME": "shared"},
command=nix-shell + ["krebs-ci"])
+>>>>>>> f59080e76f950a5a8e33d1edd4314ffaa14187fc
c['builders'].append(
util.BuilderConfig(name="full-tests",
@@ -116,7 +121,7 @@ let
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = False,
- stopBuild = False,
+ stopBuild = 'auth',
stopAllBuilds = False,
cancelPendingBuild = False,
)
@@ -229,6 +234,9 @@ let
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.git ];
+ environment = {
+ SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
+ };
serviceConfig = let
workdir="${lib.shell.escape cfg.workDir}";
secretsdir="${lib.shell.escape (toString <secrets>)}";
diff --git a/krebs/3modules/buildbot/slave.nix b/krebs/3modules/buildbot/slave.nix
index 65291f63e..8711a287a 100644
--- a/krebs/3modules/buildbot/slave.nix
+++ b/krebs/3modules/buildbot/slave.nix
@@ -144,6 +144,7 @@ let
path = default-packages ++ cfg.packages;
environment = {
+ SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_REMOTE="daemon";
} // cfg.extraEnviron;
diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix
index 7df7b7d3c..0562fe836 100644
--- a/krebs/5pkgs/default.nix
+++ b/krebs/5pkgs/default.nix
@@ -40,6 +40,10 @@ subdirs // rec {
}
'';
+ test = {
+ infest-cac-centos7 = pkgs.callPackage ./test/infest-cac-centos7 {};
+ };
+
execveBin = name: cfg: execve name (cfg // { destination = "/bin/${name}"; });
writeC = name: { destination ? "" }: src: pkgs.runCommand name {} ''
diff --git a/krebs/5pkgs/krebs-ci/default.nix b/krebs/5pkgs/test/infest-cac-centos7/default.nix
index f5b302b52..7f2e3f231 100644
--- a/krebs/5pkgs/krebs-ci/default.nix
+++ b/krebs/5pkgs/test/infest-cac-centos7/default.nix
@@ -1,7 +1,9 @@
{ stdenv, coreutils,makeWrapper, cac, cacpanel, gnumake, gnused, jq, openssh, ... }:
stdenv.mkDerivation rec {
- name = "krebs-ci-0.1.0";
+ name = "${shortname}-${version}";
+ shortname = "infest-cac-centos7";
+ version = "0.2.0";
src = ./notes;
@@ -23,9 +25,9 @@ stdenv.mkDerivation rec {
installPhase =
''
mkdir -p $out/bin
- cp ${src} $out/bin/krebs-ci
- chmod +x $out/bin/krebs-ci
- wrapProgram $out/bin/krebs-ci \
+ cp ${src} $out/bin/${shortname}
+ chmod +x $out/bin/${shortname}
+ wrapProgram $out/bin/${shortname} \
--prefix PATH : ${path}
'';
meta = with stdenv.lib; {
diff --git a/krebs/5pkgs/krebs-ci/notes b/krebs/5pkgs/test/infest-cac-centos7/notes
index f162656f7..1e350084c 100755
--- a/krebs/5pkgs/krebs-ci/notes
+++ b/krebs/5pkgs/test/infest-cac-centos7/notes
@@ -24,7 +24,7 @@ export cac_servers_cache=$krebs_secrets/servers_cache.json
export cac_tasks_cache=$krebs_secrets/tasks_cache.json
export cac_templates_cache=$krebs_secrets/templates_cache.json
# we need to receive this key from buildmaster to speed up tinc bootstrap
-TRAP="rm -r $krebs_secrets;exit"
+TRAP="rm -r $krebs_secrets;trap - INT TERM EXIT"
trap "$TRAP" INT TERM EXIT
cat > $sec_file <<EOF
@@ -45,16 +45,17 @@ name=$( cac build cpu=1 ram=512 storage=10 os=26 2>&1\
| jq -r .servername)
id=servername:$name
-trap "cac delete $id;$TRAP" INT TERM EXIT
+trap "cac delete $id;$TRAP;exit" INT TERM EXIT
# TODO: timeout?
-# cac_always_update=true cac waitstatus $id "Powered On"
wait_login_cac(){
# timeout
for t in `seq 180`;do
# now we have a working cac server
- if cac ssh $1 cat /etc/redhat-release | \
- grep CentOS ;then
+ if cac ssh $1 -o ConnectTimeout=10 \
+ -o BatchMode=yes \
+ cat /etc/redhat-release | \
+ grep CentOS ;then
return 0
fi
sleep 10