From: Ivan Kohler Date: Thu, 10 Sep 2015 00:28:14 +0000 (-0700) Subject: no need for scalar X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=e0dd3887a47d291f804d20fb5a47bf1587663160;hp=aaecb642260b19488b469e57e5b1a11abcd87620;p=freeside.git no need for scalar --- diff --git a/FS-Test/Makefile.PL b/FS-Test/Makefile.PL deleted file mode 100644 index cea088a4c..000000000 --- a/FS-Test/Makefile.PL +++ /dev/null @@ -1,34 +0,0 @@ -use 5.006; -use strict; -use warnings FATAL => 'all'; -use ExtUtils::MakeMaker; -use File::ShareDir::Install; - -install_share dist => 'share'; - -WriteMakefile( - NAME => 'FS::Test', - AUTHOR => q{Mark Wells }, - VERSION_FROM => 'lib/FS/Test.pm', - ABSTRACT => 'Freeside test suite', - LICENSE => 'agpl_3', - PL_FILES => {}, - EXE_FILES => [ glob 'bin/*' ], - MIN_PERL_VERSION => 5.006, - CONFIGURE_REQUIRES => { - 'ExtUtils::MakeMaker' => 0, - 'File::ShareDir::Install' => 0, - }, - BUILD_REQUIRES => { - 'Test::More' => 0, - }, - PREREQ_PM => { - 'WWW::Mechanize' => 0, - }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'FS-Test-*' }, -); - -package MY; -use File::ShareDir::Install qw(postamble); - diff --git a/FS-Test/README b/FS-Test/README index b1518bd6f..8e9681cef 100644 --- a/FS-Test/README +++ b/FS-Test/README @@ -2,42 +2,36 @@ FS-Test INSTALLATION -To install this module, install Freeside as usual. Then run the following -commands: - - perl Makefile.PL - make - make install - -INITIALIZATION - -Run "freeside-test-start" from an account that can sudo to root. This will -create a database with the test image and set the system clock to one day -after the last bill. If there's an existing Freeside database, it will be -renamed to "freeside_YYYYMMDD" (the current date). - -To restore the system clock and put the existing database back in place, -run "freeside-test-stop". +This module no longer needs to be installed. Run it directly from the source +tree. RUNNING TESTS -"freeside-test-run" is the main test script. Currently there's only one -test plan, "ui_tests". freeside-test-run will: +"freeside-test-run" is the main test script. Currently there's only one test +plan, "ui_tests". freeside-test-run will: - download all the URLs listed in the test plan into a directory in /tmp - compare them to the reference versions with "diff -ur" - write the output to "freeside_test.YYYYMMDD.diff" -- display the results of "diffstat" on that diff The raw output directory will not be deleted, so you can examine the results -yourself. This is recommended for files that don't diff nicely like Excel -versions of reports and PDF invoices. +yourself. + +If you want to do anything with the database besides compare the test results +to reference, run "freeside-test-start" by hand first. This will create a +database with the test image and start Apache with a fake time of one day after +the last bill. If there's an existing Freeside database, it will be renamed to +"freeside_YYYYMMDD" (the current date). + +To put the existing database back in place, run "freeside-test-stop", then +restart Apache and any Freeside services. UPDATING THE REFERENCE PAGES The simplest way to update the reference copies of the test pages is -freeside-test-fetch -d ./share/output +bin/freeside-test-start +bin/freeside-test-fetch -d ./share/output (from the FS-Test source directory). If you're installing from a git repo, this will overwrite the working tree with the newly downloaded test pages. diff --git a/FS-Test/bin/freeside-test-fetch b/FS-Test/bin/freeside-test-fetch index ccc8528ff..953005704 100755 --- a/FS-Test/bin/freeside-test-fetch +++ b/FS-Test/bin/freeside-test-fetch @@ -1,8 +1,14 @@ #!/usr/bin/perl use strict; -use FS::Test; use Getopt::Std; +use File::Spec; + +my @dirs = File::Spec->splitdir(File::Spec->rel2abs(__FILE__)); +splice @dirs, -2; # bin/freeside-test-run +push @INC, File::Spec->catdir( @dirs, 'lib' ); +eval "use FS::Test;"; +die $@ if $@; my %opt; diff --git a/FS-Test/bin/freeside-test-run b/FS-Test/bin/freeside-test-run old mode 100644 new mode 100755 index add1e9b25..853bdc9a8 --- a/FS-Test/bin/freeside-test-run +++ b/FS-Test/bin/freeside-test-run @@ -2,18 +2,20 @@ set -ae -tempdir=$( mktemp -d freeside-test.XXXX ) -sharedir=$(perl -MFS::Test -e "print FS::Test::share_dir()") +tempdir=$( mktemp -d --tmpdir freeside-test.XXXX ) +# get the parent directory of bin/(this script) +testroot=$( dirname ${BASH_SOURCE[0]} ) +testroot=$( cd $testroot; cd ..; pwd ) echo "Starting test mode." -freeside-test-start +$testroot/bin/freeside-test-start echo "Saving results to $tempdir." -freeside-test-fetch -d $tempdir +$testroot/bin/freeside-test-fetch -d $tempdir echo "Exiting test mode." -freeside-test-stop || true +$testroot/bin/freeside-test-stop || true diffname=freeside-test.`date +%Y%m%d`.diff echo "Writing diff to $diffname." -diff -urb "$sharedir/output" "$tempdir" > $diffname +diff -urb "$testroot/share/output" "$tempdir" > $diffname diffstat -C $diffname diff --git a/FS-Test/bin/freeside-test-start b/FS-Test/bin/freeside-test-start index cfa1adbc5..3ab8221b9 100755 --- a/FS-Test/bin/freeside-test-start +++ b/FS-Test/bin/freeside-test-start @@ -4,12 +4,15 @@ VERSION='3.8.1' set -ae +# get the parent directory of bin/(this script) +testroot=$( dirname ${BASH_SOURCE[0]} ) +testroot=$( cd $testroot; cd ..; pwd ) + echo "Stopping services." sudo service freeside stop sudo service apache2 stop newname=freeside_`date +%Y%m%d` -sharedir=$(perl -MFS::Test -e "print FS::Test::share_dir()") # get company_name from existing DB, strip whitespace # (if there is no existing DB, continue anyway) @@ -34,7 +37,7 @@ fi if [ $createdb = YES ]; then echo "Creating new database from stock schema." createdb --owner=freeside freeside - sudo -u freeside psql freeside -q -f $sharedir/test.sql > /dev/null + sudo -u freeside psql freeside -q -f $testroot/share/test.sql > /dev/null fi if [ -f /usr/local/etc/freeside/htpasswd ]; then @@ -44,7 +47,7 @@ if [ -f /usr/local/etc/freeside/htpasswd ]; then fi echo "Installing new htpasswd." -sudo cp $sharedir/htpasswd /usr/local/etc/freeside/htpasswd +sudo cp $testroot/share/htpasswd /usr/local/etc/freeside/htpasswd newtime=$(sudo -u freeside \ psql -tc 'SELECT to_timestamp(max(_date) + 86400) FROM cust_bill' \ diff --git a/FS-Test/bin/freeside-test-stop b/FS-Test/bin/freeside-test-stop index 08485f796..5e221a85b 100755 --- a/FS-Test/bin/freeside-test-stop +++ b/FS-Test/bin/freeside-test-stop @@ -38,9 +38,6 @@ oldname=$( psql -tl | \ if [ -n "$oldname" ]; then echo "Renaming $oldname to freeside." psql postgres -c "ALTER DATABASE $oldname RENAME TO freeside" - echo "Restarting services." - sudo service apache2 restart - sudo service freeside restart fi echo "Done." diff --git a/FS-Test/lib/FS/Test.pm b/FS-Test/lib/FS/Test.pm index 8b1523388..be58ce573 100644 --- a/FS-Test/lib/FS/Test.pm +++ b/FS-Test/lib/FS/Test.pm @@ -4,14 +4,15 @@ use 5.006; use strict; use warnings FATAL => 'all'; -use File::ShareDir 'dist_dir'; +#use File::ShareDir 'dist_dir'; use WWW::Mechanize; use File::chdir; use URI; use File::Slurp qw(write_file); use Class::Accessor 'antlers'; +use File::Spec; -our $VERSION = '0.01'; +our $VERSION = '0.02'; =head1 NAME @@ -29,7 +30,11 @@ database image, the test plan, and probably other stuff. =cut sub share_dir { - dist_dir('FS-Test') +# dist_dir('FS-Test') +# we no longer install this anywhere + my @dirs = File::Spec->splitdir(File::Spec->rel2abs(__FILE__)); + splice @dirs, -3; # lib/FS/Test.pm + File::Spec->catdir( @dirs, 'share' ); } =item new OPTIONS diff --git a/FS-Test/share/output/browse/part_pkg.cgi/active=1 b/FS-Test/share/output/browse/part_pkg.cgi/active=1 index 2b3e34555..4aabefbcf 100644 --- a/FS-Test/share/output/browse/part_pkg.cgi/active=1 +++ b/FS-Test/share/output/browse/part_pkg.cgi/active=1 @@ -1124,7 +1124,7 @@ function filter_change() { window.location = 'http://localhost/freeside/browse/ -
prorate_verbose: 1
prorate_round_day: 1
cutoff_day: 1
+
cutoff_day: 1
prorate_round_day: 1
prorate_verbose: 1
@@ -1178,7 +1178,7 @@ function filter_change() { window.location = 'http://localhost/freeside/browse/ -
prorate_round_day: 1
cutoff_day: 1
prorate_verbose: 1
+
cutoff_day: 1
prorate_round_day: 1
prorate_verbose: 1
diff --git a/FS-Test/share/output/browse/part_svc.cgi/orderby=active b/FS-Test/share/output/browse/part_svc.cgi/orderby=active index 9002503d4..2c56806b4 100644 --- a/FS-Test/share/output/browse/part_svc.cgi/orderby=active +++ b/FS-Test/share/output/browse/part_svc.cgi/orderby=active @@ -955,7 +955,7 @@ function part_export_areyousure(href) { - sec_phrase + blocknum Fixed (unchangeable) @@ -967,8 +967,8 @@ function part_export_areyousure(href) { - popnum - Access number + cf_privatekey + Fixed (unchangeable) @@ -979,8 +979,8 @@ function part_export_areyousure(href) { - sectornum - Tower sector + dir + Home directory Fixed (unchangeable) @@ -991,20 +991,21 @@ function part_export_areyousure(href) { - uid - UID + domsvc + Domain Fixed (unchangeable) - + 1 + Yes - gid - GID + finger + Real name Fixed (unchangeable) @@ -1015,8 +1016,8 @@ function part_export_areyousure(href) { - finger - Real name + gid + GID Fixed (unchangeable) @@ -1027,8 +1028,8 @@ function part_export_areyousure(href) { - dir - Home directory + pbxsvc + PBX Fixed (unchangeable) @@ -1039,8 +1040,8 @@ function part_export_areyousure(href) { - shell - Shell + popnum + Access number Fixed (unchangeable) @@ -1063,8 +1064,8 @@ function part_export_areyousure(href) { - slipip - IP address + routernum + Fixed (unchangeable) @@ -1075,7 +1076,7 @@ function part_export_areyousure(href) { - routernum + sec_phrase Fixed (unchangeable) @@ -1087,8 +1088,8 @@ function part_export_areyousure(href) { - blocknum - + sectornum + Tower sector Fixed (unchangeable) @@ -1099,21 +1100,20 @@ function part_export_areyousure(href) { - domsvc - Domain + shell + Shell Fixed (unchangeable) - 1 + - Yes - pbxsvc - PBX + slipip + IP address Fixed (unchangeable) @@ -1124,8 +1124,8 @@ function part_export_areyousure(href) { - cf_privatekey - + uid + UID Fixed (unchangeable) @@ -1181,8 +1181,8 @@ function part_export_areyousure(href) { - suffix - + au_eligibility_type + AU Eligibility Type Fixed (unchangeable) @@ -1193,8 +1193,8 @@ function part_export_areyousure(href) { - catchall - + au_registrant_name + AU Registrant Name Fixed (unchangeable) @@ -1205,8 +1205,8 @@ function part_export_areyousure(href) { - quota - Quota + catchall + Fixed (unchangeable) @@ -1217,7 +1217,7 @@ function part_export_areyousure(href) { - registrarnum + expiration_date Fixed (unchangeable) @@ -1229,8 +1229,8 @@ function part_export_areyousure(href) { - registrarkey - + quota + Quota Fixed (unchangeable) @@ -1241,7 +1241,7 @@ function part_export_areyousure(href) { - setup_date + registrarkey Fixed (unchangeable) @@ -1253,7 +1253,7 @@ function part_export_areyousure(href) { - renewal_interval + registrarnum Fixed (unchangeable) @@ -1265,7 +1265,7 @@ function part_export_areyousure(href) { - expiration_date + renewal_interval Fixed (unchangeable) @@ -1277,8 +1277,8 @@ function part_export_areyousure(href) { - au_registrant_name - AU Registrant Name + setup_date + Fixed (unchangeable) @@ -1289,8 +1289,8 @@ function part_export_areyousure(href) { - au_eligibility_type - AU Eligibility Type + suffix + Fixed (unchangeable) @@ -1334,8 +1334,8 @@ function part_export_areyousure(href) { - description - Descriptive label + altitude + Altitude Fixed (unchangeable) @@ -1346,8 +1346,8 @@ function part_export_areyousure(href) { - routernum - Router/block + authkey + Authentication key Fixed (unchangeable) @@ -1370,8 +1370,8 @@ function part_export_areyousure(href) { - sectornum - Tower/sector + description + Descriptive label Fixed (unchangeable) @@ -1382,32 +1382,32 @@ function part_export_areyousure(href) { - speed_up - Upload speed (Kbps) + latitude + Latitude Fixed (unchangeable) - 1024 + - speed_down - Download speed (Kbps) + longitude + Longitude Fixed (unchangeable) - 1024 + - authkey - Authentication key + performance_profile + Peformance Profile Fixed (unchangeable) @@ -1418,8 +1418,8 @@ function part_export_areyousure(href) { - latitude - Latitude + plan_id + Service Plan Id Fixed (unchangeable) @@ -1430,8 +1430,8 @@ function part_export_areyousure(href) { - longitude - Longitude + poe_location + POE Location Fixed (unchangeable) @@ -1442,8 +1442,8 @@ function part_export_areyousure(href) { - altitude - Altitude + radio_location + Radio Location Fixed (unchangeable) @@ -1454,8 +1454,8 @@ function part_export_areyousure(href) { - vlan_profile - VLAN profile + radio_serialnum + Radio Serial Number Fixed (unchangeable) @@ -1466,8 +1466,8 @@ function part_export_areyousure(href) { - performance_profile - Peformance Profile + routernum + Router/block Fixed (unchangeable) @@ -1478,8 +1478,8 @@ function part_export_areyousure(href) { - plan_id - Service Plan Id + rssi + RSSI Fixed (unchangeable) @@ -1490,8 +1490,8 @@ function part_export_areyousure(href) { - radio_serialnum - Radio Serial Number + sectornum + Tower/sector Fixed (unchangeable) @@ -1502,8 +1502,8 @@ function part_export_areyousure(href) { - radio_location - Radio Location + serviceid + Torrus serviceid Fixed (unchangeable) @@ -1514,8 +1514,8 @@ function part_export_areyousure(href) { - poe_location - POE Location + shared_svcnum + Shared Service Fixed (unchangeable) @@ -1526,32 +1526,32 @@ function part_export_areyousure(href) { - rssi - RSSI + speed_down + Download speed (Kbps) Fixed (unchangeable) - + 1024 - suid - SUID + speed_up + Upload speed (Kbps) Fixed (unchangeable) - + 1024 - shared_svcnum - Shared Service + suid + SUID Fixed (unchangeable) @@ -1562,8 +1562,8 @@ function part_export_areyousure(href) { - serviceid - Torrus serviceid + vlan_profile + VLAN profile Fixed (unchangeable) @@ -1607,8 +1607,8 @@ function part_export_areyousure(href) { - countrycode - Country code + circuit_svcnum + Circuit Fixed (unchangeable) @@ -1619,20 +1619,20 @@ function part_export_areyousure(href) { - sim_imsi - IMSI + countrycode + Country code Fixed (unchangeable) - + 1 - phone_name - Name + domsvc + Domain Fixed (unchangeable) @@ -1643,8 +1643,8 @@ function part_export_areyousure(href) { - pbxsvc - PBX + e911_class + E911 Service Class Fixed (unchangeable) @@ -1655,8 +1655,8 @@ function part_export_areyousure(href) { - domsvc - Domain + e911_type + E911 Service Type Fixed (unchangeable) @@ -1667,8 +1667,8 @@ function part_export_areyousure(href) { - forwarddst - Forward Destination + email + Email Fixed (unchangeable) @@ -1679,8 +1679,8 @@ function part_export_areyousure(href) { - email - Email + forwarddst + Forward Destination Fixed (unchangeable) @@ -1691,8 +1691,8 @@ function part_export_areyousure(href) { - lnp_status - LNP Status + lnp_desired_due_date + LNP Desired Due Date Fixed (unchangeable) @@ -1703,8 +1703,8 @@ function part_export_areyousure(href) { - portable - Portable? + lnp_due_date + LNP Due Date Fixed (unchangeable) @@ -1715,8 +1715,8 @@ function part_export_areyousure(href) { - lrn - LRN + lnp_other_provider + LNP Other Provider Fixed (unchangeable) @@ -1727,8 +1727,8 @@ function part_export_areyousure(href) { - lnp_desired_due_date - LNP Desired Due Date + lnp_other_provider_account + LNP Other Provider Account # Fixed (unchangeable) @@ -1739,8 +1739,8 @@ function part_export_areyousure(href) { - lnp_due_date - LNP Due Date + lnp_reject_reason + LNP Reject Reason Fixed (unchangeable) @@ -1751,8 +1751,8 @@ function part_export_areyousure(href) { - lnp_other_provider - LNP Other Provider + lnp_status + LNP Status Fixed (unchangeable) @@ -1763,8 +1763,8 @@ function part_export_areyousure(href) { - lnp_other_provider_account - LNP Other Provider Account # + lrn + LRN Fixed (unchangeable) @@ -1775,8 +1775,8 @@ function part_export_areyousure(href) { - lnp_reject_reason - LNP Reject Reason + max_simultaneous + Maximum number of simultaneous users Fixed (unchangeable) @@ -1787,8 +1787,8 @@ function part_export_areyousure(href) { - sms_carrierid - SMS Carrier + pbxsvc + PBX Fixed (unchangeable) @@ -1799,8 +1799,8 @@ function part_export_areyousure(href) { - sms_account - SMS Carrier Account + phone_name + Name Fixed (unchangeable) @@ -1811,8 +1811,8 @@ function part_export_areyousure(href) { - max_simultaneous - Maximum number of simultaneous users + portable + Portable? Fixed (unchangeable) @@ -1823,8 +1823,8 @@ function part_export_areyousure(href) { - e911_class - E911 Service Class + sim_imsi + IMSI Fixed (unchangeable) @@ -1835,8 +1835,8 @@ function part_export_areyousure(href) { - e911_type - E911 Service Type + sip_server + SIP Host Fixed (unchangeable) @@ -1847,20 +1847,20 @@ function part_export_areyousure(href) { - circuit_svcnum - Circuit + sms_account + SMS Carrier Account Fixed (unchangeable) - 1 + - sip_server - SIP Host + sms_carrierid + SMS Carrier Fixed (unchangeable) diff --git a/FS-Test/share/output/edit/cust_main.cgi/135 b/FS-Test/share/output/edit/cust_main.cgi/135 index 36b93f9a8..0eddec9da 100644 --- a/FS-Test/share/output/edit/cust_main.cgi/135 +++ b/FS-Test/share/output/edit/cust_main.cgi/135 @@ -2168,6 +2168,11 @@ myMenu63.width = 256; >United States (US) + - + >Prorate (Nth of month billing), with intro period - + >Prorate (calendar cycle)