~ccharles/mysql-sandbox/mysql-sandbox-3-ecosystem

« back to all changes in this revision

Viewing changes to README

  • Committer: Giuseppe Maxia
  • Date: 2009-05-02 05:11:02 UTC
  • Revision ID: g.maxia@gmail.com-20090502051102-oeox2rgju7ommdot
- Added user defined test in Perl, in addition to the ones written in the test_sandbox script language
- Updated documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
    Starting with version 2.0.99, you can define your own tests, and run
514
514
    them by
515
515
 
516
 
      $ test_sandbox --tests=user --user_test=file_name
 
516
      $ test_sandbox --user_test=file_name
517
517
 
 
518
   simplified test script
518
519
    Inside your test file, you can define test actions. There are two kind
519
520
    of tests: shell and sql the test type is defined by a keyword followed
520
521
    by a colon.
554
555
 
555
556
      command = /home/sb/tests/msb_5_1_30/stop
556
557
 
 
558
   Perl based test scripts
 
559
    In addition to the internal script language, you can also define perl
 
560
    scripts, which will be able to call routines defined inside
 
561
    test_sandbox. (see list below) To be identified as a Perl script, the
 
562
    user defined test must have the extension ".sb.pl"
 
563
 
 
564
    ok_shell()
 
565
       The "ok_shell" function requires a hash reference containing the
 
566
       following labels: A 'command', which is passed to a shell. The
 
567
       'expected' label is a string that you expect to find within the shell
 
568
       output. If you don't expect anything, you can just say "expected =
 
569
       OK", meaning that you will be satisfied with a ZERO exit code
 
570
       reported by the operating system. The 'msg' is the description of the
 
571
       test that is shown to you when the test runs.
 
572
 
 
573
         ok_shell($hashref)
 
574
         ok_shell({
 
575
               command  => 'make_sandbox 5.1.30 --no_confirm',
 
576
               expected => 'sandbox server started',
 
577
               msg      => 'sandbox creation',
 
578
               })
 
579
 
 
580
    ok_sql()
 
581
       The "ok_sql" function requires a hashref containing the following
 
582
       labels: A 'path', which is the place where the test engine expects to
 
583
       find a 'use' script. The 'query' is passed to the above mentioned
 
584
       script and the output is captured for further processing. The
 
585
       'expected' parameter is a string that you want to find in the query
 
586
       output. The 'msg' parameter is like the one used with the ok_exec
 
587
       function.
 
588
 
 
589
    get_bare_version()
 
590
       This function accepts one parameter, which can be either a MySQL
 
591
       tarball name or a version, and returns the bare version found in the
 
592
       input string. If called in list mode, it returns also a normalized
 
593
       version string with dots replaced by underscores.
 
594
 
 
595
           my $version = get_bare_version('5.1.30'); 
 
596
           # returns '5.1.30'
 
597
 
 
598
           my $version = get_bare_version('mysql-5.1.30-OS.tar.gz'); 
 
599
           # returns '5.1.30'
 
600
 
 
601
           my ($version,$dir_name) = get_bare_version('mysql-5.1.30-OS.tar.gz'); 
 
602
           # returns ('5.1.30', '5_1_30')
 
603
 
 
604
       See the test script t/start_restart_arguments.sb.pl as an example
 
605
 
557
606
REQUIREMENTS
558
 
    To use this package you need at least the following:
559
 
 
560
 
    *  Linux or Mac OSX operating system (it may work in other *NIX OSs, but
561
 
       has not been tested)
562
 
 
563
 
    *  A binary tarball of MySQL 3.23 or later
564
 
 
565
 
    *  Perl 5.8.1 or later
566
 
 
567
 
    *  Bash shell
 
607
       To use this package you need at least the following:
 
608
 
 
609
       *  Linux or Mac OSX operating system (it may work in other *NIX OSs,
 
610
          but has not been tested)
 
611
 
 
612
       *  A binary tarball of MySQL 3.23 or later
 
613
 
 
614
       *  Perl 5.8.1 or later
 
615
 
 
616
       *  Bash shell
568
617
 
569
618
COPYRIGHT
570
 
    Version 3.0
571
 
 
572
 
    Copyright (C) 2006,2007,2008,2009 Giuseppe Maxia
573
 
 
574
 
    Home Page http://launchpad.net/mysql-sandbox/
 
619
       Version 3.0
 
620
 
 
621
       Copyright (C) 2006,2007,2008,2009 Giuseppe Maxia
 
622
 
 
623
       Home Page http://launchpad.net/mysql-sandbox/
575
624
 
576
625
LEGAL NOTICE
577
 
    This program is free software; you can redistribute it and/or modify it
578
 
    under the terms of the GNU General Public License as published by the
579
 
    Free Software Foundation; version 2 of the License.
580
 
 
581
 
    This program is distributed in the hope that it will be useful, but
582
 
    WITHOUT ANY WARRANTY; without even the implied warranty of
583
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
584
 
    Public License for more details.
585
 
 
586
 
    You should have received a copy of the GNU General Public License along
587
 
    with this program; if not, write to the Free Software Foundation, Inc.,
588
 
    51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
626
       This program is free software; you can redistribute it and/or modify
 
627
       it under the terms of the GNU General Public License as published by
 
628
       the Free Software Foundation; version 2 of the License.
 
629
 
 
630
       This program is distributed in the hope that it will be useful, but
 
631
       WITHOUT ANY WARRANTY; without even the implied warranty of
 
632
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
633
       General Public License for more details.
 
634
 
 
635
       You should have received a copy of the GNU General Public License
 
636
       along with this program; if not, write to the Free Software
 
637
       Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 
638
       USA
589
639