| #!/bin/sh |
| |
| |
| |
| t_Log "Running $0 - python can retrieve mysql-server version information." |
| |
| |
| t_InstallPackage mysql-server |
| t_ServiceControl mysqld start >/dev/null 2>&1 |
| |
| |
| t_InstallPackage MySQL-python |
| |
| |
| SCRIPT='/var/tmp/test.py' |
| |
| cat >$SCRIPT <<EOF |
| import MySQLdb |
| |
| conn = MySQLdb.connect (host = "localhost", |
| user = "", |
| passwd = "", |
| db = "test") |
| cursor = conn.cursor () |
| cursor.execute ("SELECT VERSION()") |
| row = cursor.fetchone () |
| print "server version:", row[0] |
| cursor.close () |
| conn.close () |
| EOF |
| |
| |
| python $SCRIPT |grep -q 'server version' |
| |
| t_CheckExitStatus $? |
| |
| |
| /bin/rm $SCRIPT |