Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: debian/test-python-poker-stats.cron.monthly
- ===================================================================
- --- debian/test-python-poker-stats.cron.monthly (revision 0)
- +++ debian/test-python-poker-stats.cron.monthly (revision 0)
- @@ -0,0 +1,27 @@
- +set -ex
- +
- +rm -f /etc/default/python-poker-stats
- +
- +sh -x ./python-poker-stats.cron.monthly && FAILED # RESET_CURRENCY=false
- +RESET_CURRENCY=true sh -x ./python-poker-stats.cron.monthly && FAILED # NO_DEFAULT_CURRENCY_SERIAL
- +
- +mysql --user=root --database=pythonpokernetwork --execute="DELETE from user2money"
- +mysql --user=root --database=pythonpokernetwork --execute="INSERT into user2money VALUES (42, 42, 1000, 1000, 1000);"
- +RESET_CURRENCY=true CURRENCY_SERIAL=42 MYSQL_USER=python-poker-net MYSQL_PASSWORD=rjBWccZypin2 MYSQL_DATABASE=pythonpokernetwork MYSQL_HOST=127.0.0.1 MYSQL_PORT=3306 sh -x ./python-poker-stats.cron.monthly
- +[ 0 -eq `mysql --user=root --database=pythonpokernetwork --skip-column-names --execute="select COUNT(*) from user2money where currency_serial = 42;"` ] || FAILED
- +
- +mysql --user=root --database=pythonpokernetwork --execute="DELETE from user2money"
- +mysql --user=root --database=pythonpokernetwork --execute="INSERT into user2money VALUES (42, 42, 1000, 1000, 1000);"
- +RESET_CURRENCY=true CURRENCY_SERIAL=42 sh -x ./python-poker-stats.cron.monthly
- +[ 0 -eq `mysql --user=root --database=pythonpokernetwork --skip-column-names --execute="select COUNT(*) from user2money where currency_serial = 42;"` ] || FAILED
- +
- +cat << EOF > /etc/default/python-poker-stats
- +RESET_CURRENCY=true
- +CURRENCY_SERIAL=42
- +EOF
- +mysql --user=root --database=pythonpokernetwork --execute="DELETE from user2money"
- +mysql --user=root --database=pythonpokernetwork --execute="INSERT into user2money VALUES (42, 42, 1000, 1000, 1000);"
- +sh -x ./python-poker-stats.cron.monthly
- +[ 0 -eq `mysql --user=root --database=pythonpokernetwork --skip-column-names --execute="select COUNT(*) from user2money where currency_serial = 42;"` ] || FAILED
- +
- +echo SUCCEED
- Index: debian/python-poker-stats.cron.monthly
- ===================================================================
- --- debian/python-poker-stats.cron.monthly (revision 0)
- +++ debian/python-poker-stats.cron.monthly (revision 0)
- @@ -0,0 +1,38 @@
- +#! /bin/sh
- +#
- +# -*- coding: iso-8859-1 -*-
- +#
- +# Copyright (C) 2008 Johan Euphrosine <proppy@aminche.com>
- +#
- +# This program is free software; you can redistribute it and/or modify
- +# it under the terms of the GNU General Public License as published by
- +# the Free Software Foundation; either version 3 of the License, or
- +# (at your option) any later version.
- +#
- +# This program is distributed in the hope that it will be useful,
- +# but WITHOUT ANY WARRANTY; without even the implied warranty of
- +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- +# GNU General Public License for more details.
- +#
- +# You should have received a copy of the GNU General Public License
- +# along with this program; if not, write to the Free Software
- +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
- +#
- +set -e
- +
- +RESET_CURRENCY=${RESET_CURRENCY=false}
- +MYSQL_USER=${MYSQL_USER=}
- +MYSQL_PASSWORD=${MYSQL_PASSWORD=}
- +MYSQL_HOST=${MYSQL_HOST=}
- +MYSQL_PORT=${MYSQL_PORT=}
- +MYSQL_DATABASE=${MYSQL_DATABASE=pythonpokernetwork}
- +CURRENCY_SERIAL=${CURRENCY_SERIAL=NO_DEFAULT_CURRENCY_SERIAL}
- +
- +if [ -f /etc/default/python-poker-stats ] ; then
- + . /etc/default/python-poker-stats
- +fi
- +
- +[ $CURRENCY_SERIAL != NO_DEFAULT_CURRENCY_SERIAL ]
- +[ $RESET_CURRENCY != false ]
- +
- +mysql --user=$MYSQL_USER --password=$MYSQL_PASSWORD --database=$MYSQL_DATABASE --host=$MYSQL_HOST --port=$MYSQL_PORT --execute="DELETE from user2money where currency_serial = $CURRENCY_SERIAL;"
- Property changes on: debian/python-poker-stats.cron.monthly
- ___________________________________________________________________
- Added: svn:executable
- + *
- Index: debian/python-poker-stats.default
- ===================================================================
- --- debian/python-poker-stats.default (revision 0)
- +++ debian/python-poker-stats.default (revision 0)
- @@ -0,0 +1,9 @@
- +#
- +# python-poker-stats default
- +#
- +
- +#
- +# Reset user money for CURRENCY_SERIAL
- +#
- +RESET_CURRENCY=false
- +CURRENCY_SERIAL=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement