mirror of
https://github.com/Yubico/yubikey-ksm.git
synced 2025-01-22 07:52:14 +01:00
start adding travis for yubikey-ksm
This commit is contained in:
parent
db7919ea9f
commit
b868157f42
10
.travis.yml
Normal file
10
.travis.yml
Normal file
@ -0,0 +1,10 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.5
|
||||
- 5.4
|
||||
- 5.3
|
||||
env:
|
||||
- DB=mysql
|
||||
- DB=pgsql
|
||||
script:
|
||||
- ./selftest.sh
|
45
selftest.sh
Normal file
45
selftest.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
packages="help2man apache2 php5-mcrypt curl"
|
||||
|
||||
if [ "x$DB" = "xmysql" ]; then
|
||||
dbuser=travis
|
||||
packages="$packages php5-mysql"
|
||||
|
||||
mysql -u $dbuser -e 'create database ykksm;'
|
||||
mysql -u $dbuser ykksm < ykksm-db.sql
|
||||
|
||||
dbrun="mysql -u $dbuser ykksm -e"
|
||||
else [ "x$DB" = "xpgsql" ]; then
|
||||
dbuser=postgres
|
||||
packages="$packages php5-pgsql"
|
||||
|
||||
psql -U $dbuser -c 'create database ykksm;'
|
||||
psql -U $dbuser ykksm < ykksm-db.sql
|
||||
|
||||
dbrun="psql -U $dbuser ykksm -c"
|
||||
fi
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq --y $packages
|
||||
|
||||
git submodule update --init
|
||||
sudo make install symlink
|
||||
sudo sh -c "echo 'include_path = "/etc/yubico/ksm:/usr/share/ykksm"' > /etc/php5/conf.d/ykksm.ini"
|
||||
sudo chmod a+r /usr/share/yubikey-ksm/* /etc/yubico/ksm/*
|
||||
cat > config-db.php << EOF
|
||||
<?php
|
||||
\$dbuser = '$dbuser';
|
||||
\$dbpass = '';
|
||||
\$dbname = 'ykksm';
|
||||
\$dbtype = '$DB';
|
||||
?>
|
||||
EOF
|
||||
sudo mv config-db.php /etc/yubico/ksm/
|
||||
|
||||
$dbrun 'insert into yubikeys (publicname,internalname,aeskey) values("idkfefrdhtru","609963eae7b5","c68c9df8cbfe7d2f994cb904046c7218");'
|
||||
|
||||
sudo /etc/init.d/apache2 restart
|
||||
curl --silent http://localhost/wsapi/decrypt?otp=idkfefrdhtrutjduvtcjbfeuvhehdvjjlbchtlenfgku | grep -q "^OK counter=0001 low=8d40 high=0f use=00" || (echo "failed OTP"; exit 1)
|
Loading…
x
Reference in New Issue
Block a user