Compare commits
439 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3a5633c73 | ||
|
|
3de6d52325 | ||
|
|
540975a5a0 | ||
|
|
1cf19ce6fd | ||
|
|
71a0ebbedf | ||
|
|
3023c91df2 | ||
|
|
bfff4b08d5 | ||
|
|
9285d8f342 | ||
|
|
87e438750d | ||
|
|
850b65fcd4 | ||
|
|
b65b4e79be | ||
|
|
2483d29b72 | ||
|
|
3d49299ca5 | ||
|
|
46e9ac3c93 | ||
|
|
80020ef97e | ||
|
|
c6d9399856 | ||
|
|
dfde34c776 | ||
|
|
5901e664a9 | ||
|
|
404a8af886 | ||
|
|
e2f35c6f0d | ||
|
|
3c31134e17 | ||
|
|
85052a3e7e | ||
|
|
8e0ab94813 | ||
|
|
df3ee07729 | ||
|
|
fe8884506e | ||
|
|
ff700ff4c7 | ||
|
|
c977238115 | ||
|
|
3afe8da5a0 | ||
|
|
9bb99e691d | ||
|
|
e7e5a1e5d9 | ||
|
|
35baecb3b8 | ||
|
|
b20bf0ddc5 | ||
|
|
8ff4eb8536 | ||
|
|
9cdf6b1874 | ||
|
|
4d12ddba96 | ||
|
|
fc521eff35 | ||
|
|
5c192fcee6 | ||
|
|
9c628426ad | ||
|
|
09e3b9b005 | ||
|
|
b47b06b8d0 | ||
|
|
df9be063f2 | ||
|
|
b531e36b6d | ||
|
|
0a14668df8 | ||
|
|
ce91b466b1 | ||
|
|
769683c183 | ||
|
|
09489ac54f | ||
|
|
ede9b430b8 | ||
|
|
0311405892 | ||
|
|
da8c868247 | ||
|
|
a80cc38d31 | ||
|
|
8b280457f3 | ||
|
|
3082df135c | ||
|
|
417122edce | ||
|
|
ea6304afc9 | ||
|
|
517900be99 | ||
|
|
f09bca90c7 | ||
|
|
25372703cb | ||
|
|
d881c8ed73 | ||
|
|
49b7802a00 | ||
|
|
d42633c44a | ||
|
|
8a6275295c | ||
|
|
86cc320f4b | ||
|
|
a28fc90efe | ||
|
|
27033a5192 | ||
|
|
93dabe6b7b | ||
|
|
e3730e423b | ||
|
|
a224760c6f | ||
|
|
0ed5f440f1 | ||
|
|
65d6dc457e | ||
|
|
9edbc87f01 | ||
|
|
b2d61b843b | ||
|
|
b63e475e3b | ||
|
|
de2f726f71 | ||
|
|
ed8fb8ecad | ||
|
|
f626509133 | ||
|
|
57ce669fe5 | ||
|
|
5c3baf99a3 | ||
|
|
acd2524c42 | ||
|
|
ac32ff5b7c | ||
|
|
41df9c86d5 | ||
|
|
a299626b7d | ||
|
|
2e223cba2e | ||
|
|
2fb030888f | ||
|
|
d3720e9ea0 | ||
|
|
ade60887c9 | ||
|
|
a276b0a4d1 | ||
|
|
bc76bc65d4 | ||
|
|
c7f2aadc4c | ||
|
|
a11937081f | ||
|
|
f53271ddf3 | ||
|
|
cd934d9792 | ||
|
|
3b65a34d15 | ||
|
|
051cd7dbe4 | ||
|
|
87a1aa9761 | ||
|
|
03fe4ab3dd | ||
|
|
f69fd06c5c | ||
|
|
31a0163fb8 | ||
|
|
5ed245ec29 | ||
|
|
66fc8c5eac | ||
|
|
531e811f2a | ||
|
|
a0b7b0186d | ||
|
|
87842c0e03 | ||
|
|
5b59b2d909 | ||
|
|
729b30b968 | ||
|
|
88fa6654b2 | ||
|
|
fe8fbe1b98 | ||
|
|
8908704fed | ||
|
|
bf361b50f0 | ||
|
|
cdf6560782 | ||
|
|
f52024568e | ||
|
|
45bad928c5 | ||
|
|
2ede099f1d | ||
|
|
c4e635158d | ||
|
|
ca4d4918bb | ||
|
|
98a7883739 | ||
|
|
7dd67a89dc | ||
|
|
2f4043dc72 | ||
|
|
ceabd81039 | ||
|
|
32634dad4d | ||
|
|
c5d3cf29bd | ||
|
|
7910383f83 | ||
|
|
213c29d271 | ||
|
|
7870f61b0a | ||
|
|
2880169ddb | ||
|
|
e359a362c0 | ||
|
|
068cbbdcf9 | ||
|
|
9ee07e85a9 | ||
|
|
473eca3600 | ||
|
|
e00f64c807 | ||
|
|
d7c3a8c81e | ||
|
|
50ecd84573 | ||
|
|
5f58fdc896 | ||
|
|
e6c8d9f546 | ||
|
|
e9a07525de | ||
|
|
aed687de07 | ||
|
|
632cb7c710 | ||
|
|
1f719b1b76 | ||
|
|
0442637fc0 | ||
|
|
e9d1062fac | ||
|
|
d324637ba2 | ||
|
|
7415aea898 | ||
|
|
8c173f4fbe | ||
|
|
dab343f9b5 | ||
|
|
b5905625e3 | ||
|
|
41e422ecc9 | ||
|
|
bfdb7c58e4 | ||
|
|
d9afc0d44a | ||
|
|
ece7eddcfe | ||
|
|
63587835a3 | ||
|
|
1e9796928e | ||
|
|
d99a94d647 | ||
|
|
335b7ef931 | ||
|
|
cb250655f9 | ||
|
|
d70e64d598 | ||
|
|
0f2f41ff6c | ||
|
|
cd0b59bf87 | ||
|
|
0aa62825da | ||
|
|
dc4b713855 | ||
|
|
9c356d59cd | ||
|
|
9e18981850 | ||
|
|
5306cc9f54 | ||
|
|
d73b2c0bc4 | ||
|
|
788d1d3e28 | ||
|
|
6d2ad9ae03 | ||
|
|
fe613f1f54 | ||
|
|
98acce582a | ||
|
|
fcc0018ab1 | ||
|
|
e94a9f98a6 | ||
|
|
2e79cbf8a6 | ||
|
|
a2435498e1 | ||
|
|
2109002dc7 | ||
|
|
c8f846b4de | ||
|
|
d49785b863 | ||
|
|
0ed26f76e5 | ||
|
|
cdcecd8879 | ||
|
|
15127d0104 | ||
|
|
29f17f1fd2 | ||
|
|
63d26f7cc0 | ||
|
|
6a84ac16f1 | ||
|
|
e2a584549d | ||
|
|
1d16a3645d | ||
|
|
11537cb636 | ||
|
|
dde77c36c8 | ||
|
|
6e9d91a24c | ||
|
|
8f8044d52a | ||
|
|
1dc5d21046 | ||
|
|
68e7e2eff9 | ||
|
|
5d9cd6991d | ||
|
|
11efbedc20 | ||
|
|
77e698c91b | ||
|
|
3ff13bd3e9 | ||
|
|
0bec2dc635 | ||
|
|
dc9f14e9dc | ||
|
|
5690996c9e | ||
|
|
5270926b30 | ||
|
|
f718524330 | ||
|
|
6fcaa42bdb | ||
|
|
2724442416 | ||
|
|
4a19981a98 | ||
|
|
2dcb331aca | ||
|
|
2e34d13d5c | ||
|
|
fc2066117a | ||
|
|
22df4734b0 | ||
|
|
9e3790b35e | ||
|
|
94d7404357 | ||
|
|
3291618016 | ||
|
|
a8d2d096ca | ||
|
|
f645969a1b | ||
|
|
ef6aeab21e | ||
|
|
fc2f0efe29 | ||
|
|
29dcb2e782 | ||
|
|
f86d9f4fbf | ||
|
|
359af64442 | ||
|
|
f076848bf9 | ||
|
|
97963cf6b2 | ||
|
|
2f3f06f35b | ||
|
|
1e8d10b121 | ||
|
|
bc9cd7f364 | ||
|
|
2bf416f16f | ||
|
|
15dd619ea1 | ||
|
|
3edf383248 | ||
|
|
b92a926614 | ||
|
|
1b5ff93462 | ||
|
|
ba2a325762 | ||
|
|
2aa88fd5e2 | ||
|
|
d5bce250dc | ||
|
|
6684d827f8 | ||
|
|
b4b1a7eb45 | ||
|
|
70c1c4bb08 | ||
|
|
9ce47ccfc5 | ||
|
|
be1867f98d | ||
|
|
3b47c0c12b | ||
|
|
2ebc4e05ff | ||
|
|
db36f95508 | ||
|
|
608b27bcf1 | ||
|
|
2b75139e87 | ||
|
|
e37789f5bd | ||
|
|
b09dad3b56 | ||
|
|
bebf9a7cd6 | ||
|
|
853d37bcbe | ||
|
|
384619146e | ||
|
|
457d284f1e | ||
|
|
d2d96af37c | ||
|
|
63669356de | ||
|
|
cbd56b106c | ||
|
|
ad2803bcde | ||
|
|
11090103e3 | ||
|
|
71ce513b02 | ||
|
|
0463bb4667 | ||
|
|
42d7246d87 | ||
|
|
af8999f5d2 | ||
|
|
681b007017 | ||
|
|
9e5a67f4f5 | ||
|
|
a1fd9e5e4d | ||
|
|
de75f7b20a | ||
|
|
dfa22abd4e | ||
|
|
62769ff58d | ||
|
|
c8322dfd4b | ||
|
|
00c86faea2 | ||
|
|
65e5fc78c1 | ||
|
|
47d43cca9b | ||
|
|
4c911b9176 | ||
|
|
9b6ae61e71 | ||
|
|
28a579136c | ||
|
|
c5dd052476 | ||
|
|
328a4366ab | ||
|
|
c757829566 | ||
|
|
c9e3db6077 | ||
|
|
a745fe09bb | ||
|
|
8ffde5b53d | ||
|
|
1e95bd2cf2 | ||
|
|
890d7fe048 | ||
|
|
8254fec563 | ||
|
|
3172e49a56 | ||
|
|
e7a2a7b5eb | ||
|
|
bbd4656b8b | ||
|
|
a4399578ee | ||
|
|
a4f0cbd53b | ||
|
|
9a3a8668e4 | ||
|
|
0b92c8019a | ||
|
|
6f562d0560 | ||
|
|
1a4995a87a | ||
|
|
22fa761e8e | ||
|
|
a6725a415d | ||
|
|
6dd96ea414 | ||
|
|
39ea33ae4e | ||
|
|
7313943017 | ||
|
|
db478c34fc | ||
|
|
4e64bac57f | ||
|
|
85f555b848 | ||
|
|
11b1ad1b14 | ||
|
|
f4ea87131c | ||
|
|
18e281d5cf | ||
|
|
82cd3c1447 | ||
|
|
8e992e5c85 | ||
|
|
8f20ff042b | ||
|
|
78d280dc5a | ||
|
|
9b77c4dbb4 | ||
|
|
95c3cf6951 | ||
|
|
99f880c34a | ||
|
|
b20b34c569 | ||
|
|
ece449f050 | ||
|
|
e15b736e1f | ||
|
|
9d8d1e689f | ||
|
|
2861672bf9 | ||
|
|
55593610dc | ||
|
|
c1c0a94cd4 | ||
|
|
9def58b211 | ||
|
|
d6b6d7631f | ||
|
|
73eef7a11a | ||
|
|
650b689ad5 | ||
|
|
673489f6f5 | ||
|
|
2db7cf9660 | ||
|
|
790b3625fe | ||
|
|
47b50018df | ||
|
|
bd7d2b4e5f | ||
|
|
52f7de4ea6 | ||
|
|
bf83f78e96 | ||
|
|
aaeea7372c | ||
|
|
43ec99b830 | ||
|
|
5433279f90 | ||
|
|
18a860d32b | ||
|
|
4e6872e31d | ||
|
|
859ebca16a | ||
|
|
4a14a868ab | ||
|
|
3a49252378 | ||
|
|
6d24497665 | ||
|
|
699ede0d95 | ||
|
|
ef968316ff | ||
|
|
6626f86cec | ||
|
|
294bfd488b | ||
|
|
92172da6b7 | ||
|
|
cb41681e9f | ||
|
|
4e4f2dde72 | ||
|
|
1299ac74e8 | ||
|
|
11e50f9c8b | ||
|
|
4167d346c6 | ||
|
|
3f93db214c | ||
|
|
72d69a8ccb | ||
|
|
3910e6f2cc | ||
|
|
eae98cc06a | ||
|
|
2c7b7f4ff3 | ||
|
|
114f94ba11 | ||
|
|
2c5070d34a | ||
|
|
f4508ea766 | ||
|
|
cf8dc18cfd | ||
|
|
25afe6313f | ||
|
|
a9042dad3a | ||
|
|
08d2c9e39b | ||
|
|
88c1d5e4cf | ||
|
|
440eb38920 | ||
|
|
e68049b612 | ||
|
|
35d8df0f08 | ||
|
|
1edd60f919 | ||
|
|
80a553e63d | ||
|
|
ff7bf7d1de | ||
|
|
bcaca6042c | ||
|
|
79ecd9ae17 | ||
|
|
6e1d45df7a | ||
|
|
dcfe9840fc | ||
|
|
2a6bec9409 | ||
|
|
58cb071b65 | ||
|
|
9c1a525514 | ||
|
|
cc5b09661e | ||
|
|
09f4dea6d4 | ||
|
|
84ed3c504f | ||
|
|
53a6a85909 | ||
|
|
f9dd9c3f2c | ||
|
|
9ee56d7ecf | ||
|
|
beb03041f3 | ||
|
|
3f09b801b2 | ||
|
|
d39b7f5307 | ||
|
|
52c533a9ee | ||
|
|
79351c4cbe | ||
|
|
9b3b5edd82 | ||
|
|
83b5115aa4 | ||
|
|
060f09067f | ||
|
|
509133e0dc | ||
|
|
2f68303085 | ||
|
|
a40c08c0a5 | ||
|
|
2718847c96 | ||
|
|
dfb06d5679 | ||
|
|
a609c20ee9 | ||
|
|
ad02af1ed3 | ||
|
|
c2b3f326c1 | ||
|
|
7c6894c700 | ||
|
|
1223ef2356 | ||
|
|
ce4d002458 | ||
|
|
eb04908e77 | ||
|
|
ab9538f922 | ||
|
|
0261dec8df | ||
|
|
fa3144fdd8 | ||
|
|
f38b88d591 | ||
|
|
5193556183 | ||
|
|
0b0ff8ddf4 | ||
|
|
8e9eea9aa2 | ||
|
|
3bdee751de | ||
|
|
68ac640236 | ||
|
|
0a90971308 | ||
|
|
ea623095be | ||
|
|
bcb5fbb03b | ||
|
|
e0a0715d09 | ||
|
|
6d595c693c | ||
|
|
9c8c810226 | ||
|
|
60437b9156 | ||
|
|
4b0dcb428f | ||
|
|
71d37b74b7 | ||
|
|
79203b63b0 | ||
|
|
66f545f5d5 | ||
|
|
257a629254 | ||
|
|
cdd0fa9db3 | ||
|
|
4025334c5b | ||
|
|
e25637aaf4 | ||
|
|
db023450cc | ||
|
|
1c11e3843b | ||
|
|
ede496a21b | ||
|
|
e45fd1a60f | ||
|
|
9fa3fd8b97 | ||
|
|
a0470e588b | ||
|
|
45f2d49dc2 | ||
|
|
53b8b48ba3 | ||
|
|
e9cb4cac84 | ||
|
|
0b63f47e68 | ||
|
|
6d59c0f03a | ||
|
|
ffd3270cab | ||
|
|
3379a6bf34 | ||
|
|
2c19337986 | ||
|
|
0148a8949c | ||
|
|
83a023a2a6 | ||
|
|
4ec0dd07da | ||
|
|
9c5e30bb50 | ||
|
|
41169330b6 | ||
|
|
53fd3ff4a7 | ||
|
|
cd87404c29 | ||
|
|
354f63a521 | ||
|
|
5d9375b48b | ||
|
|
2ab7c30cbe | ||
|
|
6a9a659429 | ||
|
|
8e43f61dee |
2
AUTHORS
2
AUTHORS
@@ -1,4 +1,4 @@
|
||||
Copyright 2008 - 2014 by Phoronix Media.
|
||||
Copyright 2008 - 2015 by Phoronix Media.
|
||||
|
||||
Lead Architects:
|
||||
|
||||
|
||||
@@ -1,6 +1,226 @@
|
||||
PHORONIX TEST SUITE CHANGE-LOG
|
||||
|
||||
Phoronix Test Suite 5.4-Lipki
|
||||
Phoronix Test Suite 5.8.1
|
||||
23 June 2015
|
||||
|
||||
- pts-core: Misc warning fixes
|
||||
- pts-core: Fix result file validation against XML schema
|
||||
- pts-core: Never show /boot/efi as possible benchmark writable mount point
|
||||
- pts-core: Don't report which errors on launcher
|
||||
- phoromatic: Add button to schedules page to allow skipping current trigger
|
||||
- phoromatic: Pass extra attributes during PDF generation to allow for PDF sorting, etc
|
||||
- phoromatic: Allow basic sub-targeting as part of test schedule trigger URLs
|
||||
- phoromatic: Enhancements to the main page
|
||||
- phoromatic: Result tracker detection improvements
|
||||
- phoromatic: Sort systems on main page
|
||||
|
||||
Phoronix Test Suite 5.8-Belev
|
||||
5 June 2015
|
||||
|
||||
- pts-core: Don't needlessly write out config file each time if nothing relevant has changed
|
||||
- pts-core: Automatically re-install tests if compiler flag environment variables change
|
||||
- pts-core: Add attr as an external dependency
|
||||
- pts-core: Fix for reading multiple dependency names
|
||||
- phoromatic: Reboot system if comm fails 10+ times on client
|
||||
- phoromatic: Add global checkbox to key pages
|
||||
- phoromatic: Track core version of clients in database
|
||||
- phoromatic: Refresh OB repository lists prior to benchmarks
|
||||
- phoromatic: Additional validation on result uploads
|
||||
- phodevi: Some basic hardware reporting improvements that help the MIPS Creator CI20
|
||||
|
||||
Phoronix Test Suite 5.8 Milestone 5
|
||||
28 May 2015
|
||||
|
||||
- pts-core: Major performance improvements when merging many result files
|
||||
- pts-core: Faster result file parsing
|
||||
- pts-core: Stress-run improvements
|
||||
- phoromatic: Improved tracker page
|
||||
- phoromatic: Updated maintenance page
|
||||
- phoromatic: Log tick sensors into sensors-pool
|
||||
- phoromatic: Show prominent sensors via the dashboard
|
||||
- phoromatic: Add graphs to systems page
|
||||
- phoromatic: Scale SVG result graphs to better page size
|
||||
- phoromatic: Add phoromatic.export-results-for-account-schedules option
|
||||
- phoromatic: Add the Phoromatic Export Viewer
|
||||
|
||||
Phoronix Test Suite 5.8 Milestone 4
|
||||
20 May 2015
|
||||
|
||||
- pts-core: Support for using DNF directly when available on Fedora
|
||||
- phodevi: Report kernel's build date when detected it's running on a daily/devel/RC kernel
|
||||
- phodevi: Fix for Radeon GPU voltage reporting
|
||||
- phodevi: Improved open-source GPU frequency detection when X Server not active
|
||||
- phoromatic: Various fixes
|
||||
- phoromatic: Add support for specifying custom client update script via account settings page to keep clients PTS updated
|
||||
- phoromatic: Change interface of reporting sensor values
|
||||
|
||||
Phoronix Test Suite 5.8 Milestone 3
|
||||
12 May 2015
|
||||
|
||||
- pts-core: Separate out WebSocket server back-ends
|
||||
- phoromatic: Honor show_local_tests_only option via the build suite page
|
||||
- phoromatic: Fix jumping on page on checkbox selection when scrolling
|
||||
- phoromatic: Don't print network connectivity messages
|
||||
- phoromatic: Set Phoromatic System Variables set by server on Phoromatic clients as env vars
|
||||
- phoromatic: Lots of early Web Sockets work
|
||||
- phoromatic: Initial support for the Mongoose Embedded Web Server, used by default if php-cgi and mongoose binaries are found in PATH
|
||||
- phoromatic: Support for tick thread
|
||||
- phoromatic: Support for reporting system sensors and client log to systems page
|
||||
- phoromatic: Add support for real-time halt testing and rebooting from the Phoromatic Web UI
|
||||
|
||||
Phoronix Test Suite 5.8 Milestone 2
|
||||
21 April 2015
|
||||
|
||||
- pts-core: Fix potential crash in list-installed-suites sub-command
|
||||
- pts-core: Enforce CCACHE_DISABLE=1 during install/runtime testing
|
||||
- pts-core: Finish removal of hhvm-server support since it's long been discontinued upstream
|
||||
- pts-core: Add pts-core/hooks/startup
|
||||
- phodevi: Reporting of Btrfs RAID levels to system component table when running disk tests
|
||||
- phoromatic: Workaround for instr() usage in SQLite that caused issues with older distributions
|
||||
- phoromatic: Add LetPublicViewResults option and new public results listing page
|
||||
- phoromatic: Update results selection on rootadmin data page
|
||||
- phoromatic: Start work on nginx server configuration (not yet working)
|
||||
- phoromatic: Add "System Targets" info to benchmark ticket page & "View All Past Tickets"
|
||||
|
||||
Phoronix Test Suite 5.8 Milestone 1
|
||||
2 April 2015
|
||||
|
||||
- pts-core: Start moving possible deployment scripts into deploy/ directory
|
||||
- pts-core: Move phoromatic-client and phoromatic-server Upstart job files to deploy/
|
||||
- pts-core: Move phoromatic-client and phoromatic-server systemd service files to deploy/
|
||||
- pts-core: Add very basic result-file-to-json sub-command
|
||||
- pts-core: Drop AnonymousHardwareReporting / AnonymousSoftwareReporting as no longer used on OpenBenchmarking.org
|
||||
- Pull in JuJu scripts from https://github.com/juju-solutions/pts to deploy/juju
|
||||
- phodevi: More allowance for clients to recover Internet connection / server communication failure
|
||||
- phoromatic: Clean-up main page schedule for schedules with no associated systems
|
||||
- phoromatic: Show matching ticket results in the compare results column on results page
|
||||
- phoromatic: Allow results page to be limited to particular hash or ticket matches
|
||||
- phoromatic: Allow results page search box to also search system's hardware/software components
|
||||
- phoromatic: Fix for removing a system from all groups on the "system group editing" systems page
|
||||
- phoromatic: Allow per-system overriding of whether automatic power-offs of system are permitted
|
||||
- phoromatic: Get rid of block-poweroff file check in client module now that it can be done per-system from server-side
|
||||
- phoromatic: Allow WoL power-ups for honoring benchmark tickets
|
||||
- phoromatic: Unify more code from start.php into phoromatic_server
|
||||
- phoromatic: Always unset the GRUB recordfail when applicable
|
||||
- phoromatic: Add "System Maintenance Table"
|
||||
- phoromatic: Add "PowerOnSystemDaily" setting option to ensure regardless of schedule that systems will at least power-up/communicate daily if enabled
|
||||
- phoromatic: New checkbox handling on results page to manage comparisons and multi-delete results
|
||||
- phoromatic: Start work on new main page
|
||||
|
||||
Phoronix Test Suite 5.6.0-Dedilovo
|
||||
24 March 2015
|
||||
|
||||
- pts-core: Drop bilde_renderer since it's been deprecated for a while
|
||||
- pts-core: Yield /dev/mapper/* points in auto-disk-mount-points
|
||||
- pts-core: Detect Internet presence for enterprise-setup
|
||||
- pts-core: cli_set_process_title() still emits error on OS X so block its usage
|
||||
- pts-core: Fix potential warning in detailed-system-info sub-command
|
||||
- phodevi: HFS+ file-system fallback detection on OS X
|
||||
- phodevi: Workaround Hyper Threading detection on OS X
|
||||
- phoromatic: Add universal search functionality from web interface
|
||||
- phoromatic: Improve formatting of annotations
|
||||
- phoromatic: Mark system state as unknown when communication fails and hits the event server check
|
||||
- phoromatic: Don't attempt to open DB in read-only mode if phoromatic.db not yet made
|
||||
|
||||
Phoronix Test Suite 5.6 Milestone 5
|
||||
11 March 2015
|
||||
|
||||
- pts-core: Ignore test run locking in stress/multi-run mode
|
||||
- pts-core: Allow 128 character result identifier strings
|
||||
- pts-core: Switch the dump-documentation sub-command to generating the README in md format
|
||||
- phoromatic: Change the custom From email sender to Reply-To
|
||||
- phoromatic: Finish hooking-up multi-test/stress-run functionality via the benchmark page
|
||||
- phoromatic: Send emails from rootadmin or group admin's email address where applicable rather than no-reply@
|
||||
- phoromatic: Scroll bar on local suites page condensing
|
||||
- phoromatic: Add "End Ticket" option to benchmark page
|
||||
- phoromatic: Allow stress tests up to 90 days
|
||||
- phoromatic: Allow stress runs up to 24 concurrent tests
|
||||
- phoromatic: Add basic support for annotating/commenting on result files and individual graphs
|
||||
- phoromatic: Add support for the user to delete annotations
|
||||
|
||||
Phoronix Test Suite 5.6 Milestone 4
|
||||
25 February 2015
|
||||
|
||||
- pts-core: Improvements to phoronix-test-suite make-download-cache
|
||||
- phoromatic: Add "admin data" page to let the rootadmin permanently delete schedules/results/systems
|
||||
- phoromatic: Allow for system identifier variable in benchmark tickets of .SYSTEM
|
||||
- phoromatic: Allow for system identifier variable in benchmark tickets of .GROUP
|
||||
- phoromatic: Allow tickets to be removed from the individual benchmark page
|
||||
- phoromatic: Allow creating new group accounts from the rootadmin page
|
||||
- phoromatic: Add support for repeating tickets
|
||||
- phoromatic: Add basic support for system variables
|
||||
|
||||
Phoronix Test Suite 5.6 Milestone 3
|
||||
15 February 2015
|
||||
|
||||
- phoromatic: Allow triggers to be deleted
|
||||
- phoromatic: Rely on caching for determining pre-existing cached test profiles from the web UI
|
||||
- phoromatic: Add result RSS support
|
||||
- phoromatic: Add new option to results page
|
||||
- phoromatic: Enforce new PTS sign-on whenever the PTS core version changes due to potential interface changes
|
||||
- phoromatic: Working build suite page
|
||||
- phoromatic: Add support for local suites page
|
||||
- phoromatic: Add benchmark page
|
||||
- phoromatic: Add support for viewing issued benchmark tickets
|
||||
- phoromatic: Add option to force rebuild of results databases
|
||||
- phoromatic: Prepend system ID to result string when running multiple tests without variables
|
||||
- phoromatic: Add "Test All Options" opton to build suite page
|
||||
|
||||
Phoronix Test Suite 5.6 Milestone 2
|
||||
4 February 2015
|
||||
|
||||
- pts-core: Various fixes
|
||||
- pts-core: Deb/RPM build packaging improvements.
|
||||
- pts-core: Add Markdown Readme file
|
||||
- pts-core: Add hidden ?seed_accountid= option to the welcome / account creation page for custom 6 character ID
|
||||
- pts-core: Fix for session save path on Fedora when running as normal user
|
||||
- pts-core: Import copy of FPDF locally for PDF rendering
|
||||
- phoromatic: Add a public view of test results by going to result page entry -> Result Export -> Public Viewer
|
||||
- phoromatic: Add basic "Upload To OpenBenchmarking.org" link from test result page
|
||||
- phoromatic: Allow users to reset their own password by navigating to the settings page
|
||||
- phoromatic: Add "group name" concept to Phoromatic group of accounts
|
||||
- phoromatic: Improved formatting of the public-viewer page
|
||||
- phoromatic: Allow downloading results as PDF
|
||||
- phoromatic: Allow disabling new account registration by setting custom string via rootadmin's config page
|
||||
- phoromatic: Allow setting a main page message string to show users once logging into their account, via rootadmin's config page
|
||||
- phoromatic: Don't show idling systems on the dashboard
|
||||
- phoromatic: Add IP ping test to system claim page
|
||||
- phoromatic: Introduce PPRID structure as universal unique identifier for results between accounts
|
||||
- phoromatic: Allow optional result sharing between groups / unique accounts (controlled via settings)
|
||||
- phoromatic: Add "force result sharing" option to rootadmin to override per-account settings
|
||||
- phoromatic: New result compare functionality
|
||||
- phoromatic: Support for limiting results to a certain time period
|
||||
- phoromatic: Add comparable results listing on individual result pages
|
||||
- phoromatic: Register module-discovered Phoromatic Servers with pts-core
|
||||
- phoromatic: Add "Only Advertise Cached Tests" option to rootadmin
|
||||
- phoromatic: Download latest OpenBenchmarking.org test suites/profiles in background thread from the event server
|
||||
- phoromatic: Add option to pre-seed test installs to systems when otherwise idling
|
||||
- phoromatic: Support for exporting result files to download as CSV or TXT
|
||||
- phoromatic: Add phoromatic.list-results sub-command for clients to view recent results
|
||||
- phoromatic: Add phoromatic.clone sub-command for clients to clone viewable test results
|
||||
|
||||
Phoronix Test Suite 5.6 Milestone 1
|
||||
13 January 2015
|
||||
|
||||
- pts-core: Add "short" display mode
|
||||
- pts-core: Add stress-run command to allow for concurrent stress testing / burn-in / torture testing
|
||||
- pts-core: Add TOTAL_LOOP_TIME support to stress-run
|
||||
- pts-core: Add TOTAL_LOOP_TIME=infinite support to stress-run for testing in an infinite loop
|
||||
- pts-core: Add support for libframetime output result parsing
|
||||
- phoromatic: Initial commit of basic tracker page
|
||||
- phoromatic: Better recovery of existing Phoromatic accounts on reloaded systems where the machine self ID changed
|
||||
- timed_screenshot: Fix for crash when PHP GD missing
|
||||
|
||||
Phoronix Test Suite 5.4.1-Lipki
|
||||
23 December 2014
|
||||
|
||||
- pts-core: Update AppData and systemd service files
|
||||
- pts-core: Add csv-dump-frame-latencies support to result parser
|
||||
- phoromatic: Improve formatting of result strings when merging random result files together
|
||||
- phoromatic: Add enterprise-setup sub-command
|
||||
- phoromatic: Attempt to detect and report IP address next to requested MAC address claim on the system claim page
|
||||
|
||||
Phoronix Test Suite 5.4.0-Lipki
|
||||
9 December 2014
|
||||
|
||||
- phoromatic: Main page update
|
||||
@@ -1,8 +1,7 @@
|
||||
Phoronix Test Suite 5.4.0
|
||||
# Phoronix Test Suite 5.8.1
|
||||
http://www.phoronix-test-suite.com/
|
||||
#####################################
|
||||
|
||||
The Phoronix Test Suite is the most comprehensive testing and benchmarking
|
||||
The **Phoronix Test Suite** is the most comprehensive testing and benchmarking
|
||||
platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The
|
||||
Phoronix Test Suite allows for carrying out tests in a fully automated manner
|
||||
from test installation to execution and reporting. All tests are meant to be
|
||||
@@ -31,15 +30,15 @@ seamless collection of test profiles and/or additional test suites. A test
|
||||
profile consists of a set of bash/shell scripts and XML files while a test suite
|
||||
is a single XML file.
|
||||
|
||||
OpenBenchmarking.org <http://www.openbenchmarking.org/> also allows for
|
||||
[OpenBenchmarking.org](http://www.openbenchmarking.org/) also allows for
|
||||
conducting side-by-side result comparisons, a central location for storing and
|
||||
sharing test results, and collaborating over test data. Phoromatic
|
||||
<http://www.phoromatic.com/> is a complementary platform to OpenBenchmarking.org
|
||||
and the Phoronix Test Suite for interfacing with Phoronix Test Suite client(s)
|
||||
to automatically execute test runs on a timed, per-commit, or other
|
||||
trigger-driven basis. Phoromatic is designed for enterprise and allows for the
|
||||
easy management of multiple networked systems running Phoronix Test Suite
|
||||
clients via a single web-based interface.
|
||||
sharing test results, and collaborating over test data.
|
||||
[Phoromatic](http://www.phoromatic.com/) is a complementary platform to
|
||||
OpenBenchmarking.org and the Phoronix Test Suite for interfacing with Phoronix
|
||||
Test Suite client(s) to automatically execute test runs on a timed, per-commit,
|
||||
or other trigger-driven basis. Phoromatic is designed for enterprise and allows
|
||||
for the easy management of multiple networked systems running Phoronix Test
|
||||
Suite clients via a single web-based interface.
|
||||
|
||||
Professional support and custom engineering for the Phoronix Test Suite,
|
||||
Phoromatic, and OpenBenchmarking.org is available by contacting
|
||||
@@ -49,8 +48,7 @@ Full details on the Phoronix Test Suite setup and usage is available from the
|
||||
included HTML/PDF documentation within the phoronix-test-suite package and from
|
||||
the Phoronix Test Suite web-site.
|
||||
|
||||
INSTALLATION & SETUP:
|
||||
#####################
|
||||
## INSTALLATION & SETUP:
|
||||
|
||||
The Phoronix Test Suite is supported on Linux, *BSD, Solaris, Mac OS X, and
|
||||
Windows systems. However, the most full-featured and well supported operating
|
||||
@@ -65,30 +63,29 @@ without installation from the extracted tar.gz/zip package. The only hard
|
||||
dependency on the Phoronix Test Suite is having command-line support for PHP
|
||||
(PHP 5.2+) installed. A complete PHP stack (e.g. with web-server) is NOT needed,
|
||||
but merely the PHP command-line support, which is widely available from
|
||||
operating system package managers under the name php, php5-cli, or php5.
|
||||
operating system package managers under the name `php`, `php5-cli`, or `php5`.
|
||||
|
||||
USAGE:
|
||||
######
|
||||
## USAGE:
|
||||
|
||||
The process to download, install/setup, execute, and report the results of a
|
||||
benchmark can be as simple as a command such as *phoronix-test-suite benchmark
|
||||
smallpt* to run a simple CPU test profile. If wishing to simply install a test,
|
||||
it's a matter of running *phoronix-test-suite install <test or suite name>* and
|
||||
to run it's *phoronix-test-suite run <test or suite name>*. There's also a batch
|
||||
mode for non-interactive benchmarking by first running *phoronix-test-suite
|
||||
batch-setup* and then using the *batch-run* sub-command rather than *run*.
|
||||
benchmark can be as simple as a command such as `phoronix-test-suite benchmark
|
||||
smallpt` to run a simple CPU test profile. If wishing to simply install a test,
|
||||
it's a matter of running `phoronix-test-suite install <test or suite name>` and
|
||||
to run it's `phoronix-test-suite run <test or suite name>`. There's also a batch
|
||||
mode for non-interactive benchmarking by first running `phoronix-test-suite
|
||||
batch-setup` and then using the `batch-run` sub-command rather than `run`.
|
||||
|
||||
Viewing installed system hardware and software is available via
|
||||
*phoronix-test-suite system-info* or *phoronix-test-suite detailed-system-info*
|
||||
`phoronix-test-suite system-info` or `phoronix-test-suite detailed-system-info`
|
||||
for greater verbosity.
|
||||
|
||||
Facilitating a result comparison from OpenBenchmarking.org can be done by
|
||||
running, for example, *phoronix-test-suite benchmark 1204293-BY-PHORONIX357* if
|
||||
running, for example, `phoronix-test-suite benchmark 1204293-BY-PHORONIX357` if
|
||||
wishing to compare the results of the
|
||||
*http://openbenchmarking.org/result/1204293-BY-PHORONIX357* result file.
|
||||
`http://openbenchmarking.org/result/1204293-BY-PHORONIX357` result file.
|
||||
|
||||
Additional information is available from the Phoronix Test Suite web-site
|
||||
<http://www.phoronix-test-suite.com/> and the material bundled within the
|
||||
phoronix-test-suite/documentation/ directory. A man page is also bundled with
|
||||
`phoronix-test-suite/documentation/` directory. A man page is also bundled with
|
||||
the phoronix-test-suite software.
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -23,7 +23,7 @@
|
||||
if(!is_executable("phoronix-test-suite") || !is_dir("pts-core/"))
|
||||
{
|
||||
echo "\nYou must run this script from the root directory of the phoronix-test-suite/ folder!\n";
|
||||
echo "Example: php5 pts-core/static/scripts/package-build-deb.php\n";
|
||||
echo "Example: php5 deploy/deb-package/build-package-deb.php\n";
|
||||
exit(0);
|
||||
}
|
||||
if(!is_executable('/usr/bin/dpkg'))
|
||||
@@ -31,6 +31,11 @@ if(!is_executable('/usr/bin/dpkg'))
|
||||
echo PHP_EOL . "dpkg must be present on the system to generate the phoronix-test-suite Debian package." . PHP_EOL . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
if(!is_executable('/usr/bin/fakeroot'))
|
||||
{
|
||||
echo PHP_EOL . "fakeroot must be present on the system to generate the phoronix-test-suite Debian package." . PHP_EOL . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
@require("pts-core/pts-core.php");
|
||||
|
||||
@@ -55,6 +60,7 @@ shell_exec("chmod +x /tmp/pts-deb-builder/usr/bin/phoronix-test-suite");
|
||||
$control_file = "Package: phoronix-test-suite\n";
|
||||
$control_file .= "Version: " . $pts_version . "\n";
|
||||
$control_file .= "Section: Utilities\n";
|
||||
$control_file .= "Installed-Size: " . shell_exec("cd /tmp/pts-deb-builder/; du -s | cut -f 1");
|
||||
$control_file .= "Priority: optional\n";
|
||||
$control_file .= "Architecture: all\n";
|
||||
$control_file .= "Depends: php5-cli, php5-gd, php5-json\n";
|
||||
@@ -64,7 +70,7 @@ $control_file .= "Description: An Automated, Open-Source Testing Framework\n " .
|
||||
$control_file .= "Homepage: http://www.phoronix-test-suite.com/ \n";
|
||||
file_put_contents("/tmp/pts-deb-builder/DEBIAN/control", $control_file);
|
||||
|
||||
shell_exec("dpkg --build /tmp/pts-deb-builder ../phoronix-test-suite_" . $pts_version . "_all.deb");
|
||||
shell_exec("fakeroot dpkg --build /tmp/pts-deb-builder ../phoronix-test-suite_" . $pts_version . "_all.deb");
|
||||
shell_exec("rm -rf /tmp/pts-deb-builder");
|
||||
|
||||
?>
|
||||
29
deploy/deployments.md
Normal file
29
deploy/deployments.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Pre-Scripted Phoronix Test Suite / Phoromatic Deployments
|
||||
|
||||
## deb-package: Generate A Debian/Ubuntu Package
|
||||
|
||||
Running `php deploy/deb-package/build-package-deb.php` from the main `phoronix-test-suite/` directory will generate a basic Phoronix-Test-Suite Debian package. This script depends upon `fakeroot` and `dpkg` being present on the system.
|
||||
|
||||
## rpm-package: Generate A RedHat/Fedora RPM Package
|
||||
|
||||
Running `php deploy/rpm-package/build-package-rpm.php` from the main `phoronix-test-suite/` directory will generate a basic Phoronix-Test-Suite RPM package for Red Hat / Fedora based distributions. This script depends upon `rpmbuild` being present on the system.
|
||||
|
||||
## phoromatic-upstart: Reference Upstart job files for Phoromatic
|
||||
|
||||
The `*.conf` files provide basic `phoromatic-client` and `phoromatic-server` job files for Upstart-powered Linux systems looking to deploy the Phoromatic on either the front or back-end. Read the Phoronix Test Suite documentation for more details.
|
||||
|
||||
## phoromatic-systemd: Reference systemd service files for Phoromatic
|
||||
|
||||
The `*.service` files provide basic `phoromatic-client` and `phoromatic-server` job files for systemd-based Linux systems looking to deploy Phoromatic for controlling the Phoronix Test Suite.
|
||||
|
||||
## phoromatic-initd: Reference sysvinit script for Phoromatic
|
||||
|
||||
The files provide basic `phoromatic-client` /etc/init.d implementation for older Linux systems.
|
||||
|
||||
## JuJu
|
||||
|
||||
Ubuntu JuJu deployment charm for the Phoronix Test Suite.
|
||||
|
||||
## farm-system-customizations: Example files of common system changes made to systems in the LinuxBenchmarking.com farm
|
||||
|
||||
Various scripts commonly used by the Phoronix reference farm / LinuxBenchmarking.com for reference purposes.
|
||||
26
deploy/farm-system-customizations/intel-xorg-headless.conf
Normal file
26
deploy/farm-system-customizations/intel-xorg-headless.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
Section "Monitor"
|
||||
Identifier "Monitor0"
|
||||
Modeline "1920x1080" 174.83 1920 2056 2248 2536 1080 1081 1084 1149 # 174.83 MHz, 68.94 kHz, 60.00 Hz
|
||||
Option "PreferredMode" "1920x1080"
|
||||
Option "Enable" "true"
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "Device0"
|
||||
Driver "intel" #Choose the driver used for this monitor
|
||||
Option "DDC" "0"
|
||||
Option "Virtualheads" "1"
|
||||
Option "Vsync" "0"
|
||||
Option "SwapbuffersWait" "0"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "Screen0" #Collapse Monitor and Device section to Screen section
|
||||
Device "Device0"
|
||||
Monitor "Monitor0"
|
||||
DefaultDepth 24 #Choose the depth (16||24)
|
||||
SubSection "Display"
|
||||
Depth 24
|
||||
Modes "1920x1080" #Choose the resolution
|
||||
EndSubSection
|
||||
EndSection
|
||||
22
deploy/farm-system-customizations/radeon-xorg-headless.conf
Normal file
22
deploy/farm-system-customizations/radeon-xorg-headless.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
Section "Device"
|
||||
Identifier "Device0"
|
||||
Driver "radeon"
|
||||
Option "SwapBuffersWait" "0"
|
||||
EndSection
|
||||
|
||||
Section "Monitor"
|
||||
Identifier "Monitor0"
|
||||
Option "enable" "true"
|
||||
Modeline "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "Fake"
|
||||
Device "Device0"
|
||||
Monitor "Monitor0"
|
||||
Option "ConnectedMonitor" "Monitor0"
|
||||
SubSection "Display"
|
||||
Depth 24
|
||||
Modes "1920x1080"
|
||||
EndSubSection
|
||||
EndSection
|
||||
10
deploy/farm-system-customizations/ubuntu-initial-setup.sh
Executable file
10
deploy/farm-system-customizations/ubuntu-initial-setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
sudo apt-get install openssh-server git-core php5-cli
|
||||
|
||||
echo "GRUB_RECORDFAIL_TIMEOUT=0" >> /etc/default/grub
|
||||
update-grub
|
||||
|
||||
sudo passwd
|
||||
|
||||
# check if needing "tty -s &&" for auto log-in user in ~/.profile
|
||||
116
deploy/juju/trusty/pts/README.md
Normal file
116
deploy/juju/trusty/pts/README.md
Normal file
@@ -0,0 +1,116 @@
|
||||
# Overview
|
||||
|
||||
[Phoronix Test Suite](http://www.phoronix-test-suite.com/) (PTS) is a comprehensive
|
||||
testing and benchmarking suite.
|
||||
|
||||
This charm requires Juju 1.23 or later and uses [Juju
|
||||
Actions](https://jujucharms.com/docs/latest/authors-charm-actions/) to run the
|
||||
benchmarks.
|
||||
|
||||
|
||||
# Usage
|
||||
|
||||
First bootstrap Juju and then deploy pts:
|
||||
|
||||
juju bootstrap
|
||||
juju deploy pts
|
||||
|
||||
From source:
|
||||
|
||||
cd phoronix-test-suite/deploy/juju
|
||||
juju deploy --repository=. local:trusty/pts
|
||||
|
||||
# Configuration
|
||||
|
||||
juju set pts user-config="`cat /path/to/user-config.xml`"
|
||||
|
||||
# Running benchmarks
|
||||
|
||||
You can list all of the actions available with the following command:
|
||||
|
||||
juju action defined pts
|
||||
|
||||
This charm supports the following benchmarks:
|
||||
|
||||
- `cpu`: CPU centric stress tests
|
||||
- `custom`: Custom stress tests
|
||||
- `io`: IO centric tests.
|
||||
- `memory`: Memory centric stress tets
|
||||
- `smoke`: Smoke test, tests that complete quickly.
|
||||
|
||||
To execute a benchmark you can use a Juju action, in this example we run the cpu
|
||||
stress tests on the first pts unit launched:
|
||||
|
||||
juju action do pts/0 cpu
|
||||
|
||||
or in this case, do a io test on pts unit 3:
|
||||
|
||||
juju action do pts/3 io
|
||||
|
||||
You can also run benchmarks across the entire pts service:
|
||||
```sh
|
||||
juju deploy pts # Deploys one unit
|
||||
juju add-unit -n10 pts # Add 10 more nodes
|
||||
juju action do pts memory # Exec the memory benchmark on all 11 pts nodes
|
||||
```
|
||||
If you want to run custom benchmarks:
|
||||
|
||||
juju action do pts/0 smoke tests='pts/apache pts/nginx'
|
||||
|
||||
# Check on actions
|
||||
|
||||
`juju action status` allows you to see the current status of an action. The benchmark results will be available once the action status has changed to `completed`.
|
||||
|
||||
```
|
||||
juju action status 7707a291-be29-46aa-8d02-2daa8ee24ebf
|
||||
actions:
|
||||
- id: 7707a291-be29-46aa-8d02-2daa8ee24ebf
|
||||
status: running
|
||||
unit: pts/0
|
||||
```
|
||||
|
||||
# Get results
|
||||
|
||||
Once an action has completed, you can fetch the results in yaml or json, in addition to the default *smart* format. The `wait` flag allows you to tell fetch how long to wait for results. This is useful if you want to block while waiting for an action to finish.
|
||||
|
||||
```
|
||||
juju action fetch --wait 0 7707a291-be29-46aa-8d02-2daa8ee24ebf
|
||||
results:
|
||||
results:
|
||||
cachebench-read:
|
||||
units: MB/s
|
||||
value: "1129.95"
|
||||
cachebench-read-modify-write:
|
||||
units: MB/s
|
||||
value: "5158.10"
|
||||
cachebench-write:
|
||||
units: MB/s
|
||||
value: "3601.54"
|
||||
phpbench:
|
||||
units: Score
|
||||
value: "35783"
|
||||
stream-add:
|
||||
units: MB/s
|
||||
value: "13187.50"
|
||||
stream-copy:
|
||||
units: MB/s
|
||||
value: "12179.08"
|
||||
stream-scale:
|
||||
units: MB/s
|
||||
value: "12292.20"
|
||||
stream-triad:
|
||||
units: MB/s
|
||||
value: "13069.26"
|
||||
status: completed
|
||||
timing:
|
||||
completed: 2015-03-23 18:47:32 +0000 UTC
|
||||
enqueued: 2015-03-23 17:51:59 +0000 UTC
|
||||
started: 2015-03-23 17:52:03 +0000 UTC
|
||||
```
|
||||
|
||||
The raw output from pts will be stored on the unit, in timestamped directories under /opt/pts/results.
|
||||
|
||||
# Contact Information
|
||||
|
||||
- Maintainer: Adam Israel <adam.israel@canonical.com>
|
||||
- [Phoronix Test Suite](http://www.phoronix-test-suite.com/) homepage
|
||||
20
deploy/juju/trusty/pts/actions.yaml
Normal file
20
deploy/juju/trusty/pts/actions.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
custom:
|
||||
description: "Custom stress tests"
|
||||
params:
|
||||
tests:
|
||||
description: "Which PTS tests to run, space delimited. See README for full list"
|
||||
type: string
|
||||
default: ""
|
||||
smoke:
|
||||
description: Smoke test, tests that complete quickly.
|
||||
params:
|
||||
tests:
|
||||
description: "Memory centric stress tests"
|
||||
type: string
|
||||
default: "pts/phpbench pts/cachebench pts/stream"
|
||||
memory:
|
||||
description: Memory centric stress tets
|
||||
cpu:
|
||||
description: CPU centric stress tests
|
||||
io:
|
||||
description: "IO centric tests."
|
||||
28
deploy/juju/trusty/pts/actions/benchmark
Executable file
28
deploy/juju/trusty/pts/actions/benchmark
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
run_benchmark() {
|
||||
chlp benchmark-start || true
|
||||
|
||||
params="$@"
|
||||
|
||||
mkdir -p /opt/pts/results
|
||||
rm -rf /root/.phoronix-test-suite
|
||||
cp -Rpf files/dotfile-phoronix-test-suite /root/.phoronix-test-suite
|
||||
|
||||
run=`date +%s`
|
||||
|
||||
userconfig=`config-get user-config`
|
||||
if [ ! -z "$userconfig" ]; then
|
||||
echo $userconfig > /root/.phoronix-test-suite/user-config.xml
|
||||
fi
|
||||
|
||||
phoronix-test-suite batch-install $params > /dev/null 2>&1
|
||||
|
||||
phoronix-test-suite batch-run $params
|
||||
rsync -aqz /root/.phoronix-test-suite /opt/pts/results/$run
|
||||
|
||||
scripts/parse /opt/pts/results/$run/.phoronix-test-suite/test-results/$(date +%Y)-*/test-1.xml
|
||||
chlp benchmark-finish || true
|
||||
}
|
||||
11
deploy/juju/trusty/pts/actions/custom
Executable file
11
deploy/juju/trusty/pts/actions/custom
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
# We're just sourcing the central benchmark, typically people will just put
|
||||
# their benchmarks in one file.
|
||||
|
||||
. actions/benchmark
|
||||
|
||||
params=`action-get tests`
|
||||
run_benchmark $params
|
||||
9
deploy/juju/trusty/pts/actions/memory
Executable file
9
deploy/juju/trusty/pts/actions/memory
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# We're just sourcing the central benchmark, typically people will just put
|
||||
# their benchmarks in one file.
|
||||
. actions/benchmark
|
||||
|
||||
run_benchmark pts/ramspeed pts/stream
|
||||
1
deploy/juju/trusty/pts/actions/smoke
Symbolic link
1
deploy/juju/trusty/pts/actions/smoke
Symbolic link
@@ -0,0 +1 @@
|
||||
custom
|
||||
18
deploy/juju/trusty/pts/config.yaml
Normal file
18
deploy/juju/trusty/pts/config.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
options:
|
||||
submit-results:
|
||||
default: false
|
||||
description: Submit the results of benchmark runs to OpenBenchmarking.org.
|
||||
type: boolean
|
||||
proxy-address:
|
||||
default: ''
|
||||
description: The address of the proxy server to use.
|
||||
type: string
|
||||
proxy-port:
|
||||
default: 0
|
||||
description: The port of the proxy server to use.
|
||||
type: int
|
||||
user-config:
|
||||
default: ''
|
||||
description: The contents of the user-config.xml to use for defaults.
|
||||
type: string
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--Phoronix Test Suite v3.6.1 (Arendal)-->
|
||||
<?xml-stylesheet type="text/xsl" href="xsl/pts-user-config-viewer.xsl"?>
|
||||
<PhoronixTestSuite>
|
||||
<Options>
|
||||
<OpenBenchmarking>
|
||||
<AnonymousUsageReporting>FALSE</AnonymousUsageReporting>
|
||||
<AnonymousSoftwareReporting>FALSE</AnonymousSoftwareReporting>
|
||||
<AnonymousHardwareReporting>FALSE</AnonymousHardwareReporting>
|
||||
<IndexCacheTTL>3</IndexCacheTTL>
|
||||
<AlwaysUploadSystemLogs>FALSE</AlwaysUploadSystemLogs>
|
||||
</OpenBenchmarking>
|
||||
<General>
|
||||
<DefaultBrowser></DefaultBrowser>
|
||||
<UsePhodeviCache>TRUE</UsePhodeviCache>
|
||||
<DefaultDisplayMode>DEFAULT</DefaultDisplayMode>
|
||||
</General>
|
||||
<Modules>
|
||||
<LoadModules>toggle_screensaver, update_checker</LoadModules>
|
||||
</Modules>
|
||||
<Installation>
|
||||
<RemoveDownloadFiles>TRUE</RemoveDownloadFiles>
|
||||
<SearchMediaForCache>TRUE</SearchMediaForCache>
|
||||
<SymLinkFilesFromCache>FALSE</SymLinkFilesFromCache>
|
||||
<PromptForDownloadMirror>FALSE</PromptForDownloadMirror>
|
||||
<EnvironmentDirectory>~/.phoronix-test-suite/installed-tests/</EnvironmentDirectory>
|
||||
<CacheDirectory>~/.phoronix-test-suite/download-cache/</CacheDirectory>
|
||||
</Installation>
|
||||
<Testing>
|
||||
<SaveSystemLogs>TRUE</SaveSystemLogs>
|
||||
<SaveInstallationLogs>TRUE</SaveInstallationLogs>
|
||||
<SaveTestLogs>TRUE</SaveTestLogs>
|
||||
<RemoveTestInstallOnCompletion>FALSE</RemoveTestInstallOnCompletion>
|
||||
<ResultsDirectory>~/.phoronix-test-suite/test-results/</ResultsDirectory>
|
||||
<AlwaysUploadResultsToOpenBenchmarking>FALSE</AlwaysUploadResultsToOpenBenchmarking>
|
||||
</Testing>
|
||||
<TestResultValidation>
|
||||
<DynamicRunCount>TRUE</DynamicRunCount>
|
||||
<LimitDynamicToTestLength>20</LimitDynamicToTestLength>
|
||||
<StandardDeviationThreshold>3.50</StandardDeviationThreshold>
|
||||
<ExportResultsTo></ExportResultsTo>
|
||||
</TestResultValidation>
|
||||
<BatchMode>
|
||||
<SaveResults>TRUE</SaveResults>
|
||||
<OpenBrowser>FALSE</OpenBrowser>
|
||||
<UploadResults>FALSE</UploadResults>
|
||||
<PromptForTestIdentifier>FALSE</PromptForTestIdentifier>
|
||||
<PromptForTestDescription>FALSE</PromptForTestDescription>
|
||||
<PromptSaveName>FALSE</PromptSaveName>
|
||||
<RunAllTestCombinations>TRUE</RunAllTestCombinations>
|
||||
<Configured>TRUE</Configured>
|
||||
</BatchMode>
|
||||
<Networking>
|
||||
<NoNetworkCommunication>FALSE</NoNetworkCommunication>
|
||||
<Timeout>20</Timeout>
|
||||
<ProxyAddress></ProxyAddress>
|
||||
<ProxyPort></ProxyPort>
|
||||
</Networking>
|
||||
</Options>
|
||||
</PhoronixTestSuite>
|
||||
@@ -0,0 +1,47 @@
|
||||
PhoronixTestSuite:
|
||||
Options:
|
||||
Installation:
|
||||
SymLinkFilesFromCache: "FALSE"
|
||||
SearchMediaForCache: "TRUE"
|
||||
EnvironmentDirectory: ~/.phoronix-test-suite/installed-tests/
|
||||
PromptForDownloadMirror: "FALSE"
|
||||
RemoveDownloadFiles: "TRUE"
|
||||
CacheDirectory: ~/.phoronix-test-suite/download-cache/
|
||||
Modules:
|
||||
LoadModules: toggle_screensaver, update_checker
|
||||
General:
|
||||
DefaultDisplayMode: DEFAULT
|
||||
DefaultBrowser:
|
||||
UsePhodeviCache: "TRUE"
|
||||
Networking:
|
||||
ProxyPort:
|
||||
ProxyAddress:
|
||||
NoNetworkCommunication: "FALSE"
|
||||
Timeout: "20"
|
||||
BatchMode:
|
||||
PromptSaveName: "FALSE"
|
||||
SaveResults: "TRUE"
|
||||
Configured: "TRUE"
|
||||
RunAllTestCombinations: "TRUE"
|
||||
PromptForTestIdentifier: "FALSE"
|
||||
OpenBrowser: "FALSE"
|
||||
UploadResults: "FALSE"
|
||||
PromptForTestDescription: "FALSE"
|
||||
TestResultValidation:
|
||||
StandardDeviationThreshold: "3.50"
|
||||
DynamicRunCount: "TRUE"
|
||||
ExportResultsTo:
|
||||
LimitDynamicToTestLength: "20"
|
||||
Testing:
|
||||
RemoveTestInstallOnCompletion: "FALSE"
|
||||
ResultsDirectory: ~/.phoronix-test-suite/test-results/
|
||||
SaveSystemLogs: "TRUE"
|
||||
AlwaysUploadResultsToOpenBenchmarking: "FALSE"
|
||||
SaveTestLogs: "TRUE"
|
||||
SaveInstallationLogs: "TRUE"
|
||||
OpenBenchmarking:
|
||||
IndexCacheTTL: "3"
|
||||
AlwaysUploadSystemLogs: "FALSE"
|
||||
AnonymousUsageReporting: "FALSE"
|
||||
AnonymousHardwareReporting: "FALSE"
|
||||
AnonymousSoftwareReporting: "FALSE"
|
||||
24
deploy/juju/trusty/pts/files/toyaml.rb
Executable file
24
deploy/juju/trusty/pts/files/toyaml.rb
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env ruby
|
||||
# Author: Peter M. Petrakis <peter.petrakis@canonical.com>
|
||||
require 'rubygems'
|
||||
require 'nokogiri'
|
||||
require 'active_support' # for enhanced Hash
|
||||
# http://dirk.net/2010/08/05/convert-between-xml-hash-yaml-json-in-ruby-conversion-cheat-sheet/
|
||||
# We can convert to JSON, YAML, whatever.
|
||||
|
||||
def return_hash()
|
||||
pts_xml = 'dotfile-phoronix-test-suite/user-config.xml'
|
||||
pts_array = Array.new
|
||||
File.open(pts_xml).each { |x| pts_array.push(x) }
|
||||
my_hash = Hash.from_xml(pts_array.to_s)
|
||||
return my_hash
|
||||
end
|
||||
|
||||
if __FILE__ == $PROGRAM_NAME
|
||||
my_hash = return_hash()
|
||||
File.open('/tmp/yaml-out', 'w') do |fd|
|
||||
my_hash.to_yaml.each { |x| fd.puts(x) }
|
||||
end
|
||||
end
|
||||
|
||||
# vim:ts=2:sw=2:et:ft=ruby:
|
||||
1
deploy/juju/trusty/pts/hooks/config-changed
Symbolic link
1
deploy/juju/trusty/pts/hooks/config-changed
Symbolic link
@@ -0,0 +1 @@
|
||||
phoronix-common
|
||||
1
deploy/juju/trusty/pts/hooks/install
Symbolic link
1
deploy/juju/trusty/pts/hooks/install
Symbolic link
@@ -0,0 +1 @@
|
||||
phoronix-common
|
||||
175
deploy/juju/trusty/pts/hooks/phoronix-common
Executable file
175
deploy/juju/trusty/pts/hooks/phoronix-common
Executable file
@@ -0,0 +1,175 @@
|
||||
#!/bin/bash -u
|
||||
# cannot use set dash e with heredoc read variable assignment
|
||||
# vim:ts=2:sw=2:et:ft=sh:
|
||||
|
||||
CWD=$(dirname $0)
|
||||
TOP=${CHARM_DIR}
|
||||
COMMAND=$(basename $0)
|
||||
|
||||
# there's some hardcoded XML that depends on this so not
|
||||
# exposing this for now
|
||||
PTSDIR="/root/.phoronix-test-suite"
|
||||
PTSARCHIVE="/root/phoronix-archive"
|
||||
|
||||
# crazy right? :)
|
||||
# http://stackoverflow.com/questions/1167746/how-to-assign-a-heredoc-value-to-a-variable-in-bash
|
||||
# http://peterpetrakis.blogspot.com/2013/07/execute-complex-python-or-ruby-code.html
|
||||
read -r -d '' upstart_status <<'EOF'
|
||||
import sys, re
|
||||
import traceback
|
||||
from subprocess import Popen, PIPE
|
||||
try:
|
||||
state = sys.stdin.read().rstrip('\n')
|
||||
g = re.match('^([\w-]+)(\s[\w+\/]+)(, \w+ \d+)?',state).groups()
|
||||
# it always returns array.len = 3, if the last one isn't None, it's running
|
||||
if g[-1] is not None:
|
||||
print 'running'
|
||||
else:
|
||||
print 'stopped'
|
||||
except Exception:
|
||||
print 'running' # assume busted
|
||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
|
||||
cmd = 'juju-log %s' % lines
|
||||
Popen(cmd.split(), stdout=PIPE)
|
||||
EOF
|
||||
|
||||
build_testsuites() {
|
||||
pts_mode=$(config-get pts_mode)
|
||||
juju-log "pts: building test config: ${pts_mode}"
|
||||
|
||||
if [ $pts_mode = 'full' ]; then
|
||||
# get each one and concat it all with some space padding
|
||||
local sys=$(config-get pts_sys)
|
||||
local cpu=$(config-get pts_cpu)
|
||||
local mem=$(config-get pts_mem)
|
||||
local io=$(config-get pts_io)
|
||||
|
||||
echo "${sys} ${cpu} ${mem} ${io}"
|
||||
|
||||
elif [ $pts_mode = 'custom' ]; then
|
||||
local tmp=$(config-get pts_custom)
|
||||
if [ -z $tmp ]; then
|
||||
echo " " # otherwise facter gets angry
|
||||
else
|
||||
echo "${tmp}"
|
||||
fi
|
||||
else
|
||||
# we default to something sensible
|
||||
echo $(config-get pts_smoke)
|
||||
fi
|
||||
}
|
||||
|
||||
# I know I could have just used vars for this but this
|
||||
# was a facter proving ground, the simplist possible use.
|
||||
install_job() {
|
||||
local job=/etc/init/cabs-runner.conf
|
||||
rm -f $job
|
||||
# the quotes around EOF suppress shell expansion
|
||||
tee $job <<'EOF'
|
||||
# run test suite
|
||||
description "Run phoronix test suite"
|
||||
|
||||
task
|
||||
|
||||
script
|
||||
mv -f /tmp/*tgz $(facter phoronix-archive) || :
|
||||
PTSRESULTS="/tmp/pts-results-$(uname -n)-$(date +%y%m%d%H%M%S).tgz"
|
||||
rm -rf $(facter phoronix-testdir) || :
|
||||
cp -Rpf $(facter phoronix-source) $(facter phoronix-testdir) || :
|
||||
echo 'Y N N' | phoronix-test-suite batch-install $(facter phoronix-testsuite)
|
||||
phoronix-test-suite batch-run $(facter phoronix-testsuite)
|
||||
tar cvf - $(facter phoronix-testdir) | gzip -c > "$PTSRESULTS"
|
||||
chmod 775 /tmp/*tgz || :
|
||||
end script
|
||||
EOF
|
||||
}
|
||||
|
||||
start_test() {
|
||||
juju-log "pts: starting test run - `date +%y%m%d%H%M%S`"
|
||||
initctl stop cabs-runner || :
|
||||
initctl start --no-wait cabs-runner || :
|
||||
}
|
||||
|
||||
stop_test() {
|
||||
juju-log "pts: stopping test run - `date +%y%m%d%H%M%S`"
|
||||
initctl stop cabs-runner || :
|
||||
}
|
||||
|
||||
clear_facts() {
|
||||
juju-log "puppet facter reset"
|
||||
fact-del phoronix-testsuite 2>&1 > /dev/null || :
|
||||
fact-del phoronix-testdir 2>&1 > /dev/null || :
|
||||
}
|
||||
|
||||
install_phoronix() {
|
||||
juju-log "installing phoronix"
|
||||
clear_facts
|
||||
stop_test
|
||||
apt-get -qq update
|
||||
apt-get install -qqy unzip build-essential default-jre-headless mesa-utils
|
||||
apt-get install -qqy phoronix-test-suite
|
||||
|
||||
# puppet helper to distribute facts between scripts
|
||||
apt-get install -qqy facter-customfacts-plugin
|
||||
|
||||
# install this to allow querying via upstart to proceed
|
||||
# for whatever reason, even though we're in 'config'
|
||||
# when we enter config_changed, the initial job isn't
|
||||
# created until we actually setup or run a test
|
||||
install_job
|
||||
|
||||
install --mode=775 -d $PTSARCHIVE
|
||||
fact-add phoronix-source "$TOP/files/dotfile-phoronix-test-suite"
|
||||
}
|
||||
|
||||
config_changed_phoronix() {
|
||||
# if we change this while a test is running we can't stop it
|
||||
# as upstart loses track of the pids
|
||||
|
||||
# We are devolving a bit in the meanwhile because of a newly
|
||||
# discovered bug in juju config where it coalesces config-set
|
||||
# under some circumstances making a deterministic interface
|
||||
# impossible.
|
||||
#
|
||||
# Until the benchmark-control interface is deployed... If you
|
||||
# try to do a config-set while the benchmark is running, config-changed
|
||||
# hook will simply die, prompting external intervention
|
||||
local state=$(initctl status cabs-runner | python -c "$upstart_status")
|
||||
juju-log "phoronix is $state"
|
||||
[ $state == 'running' ] && exit 1
|
||||
|
||||
juju-log 'configuring pts'
|
||||
|
||||
local suite=$(build_testsuites)
|
||||
fact-add phoronix-archive "$PTSARCHIVE"
|
||||
fact-add phoronix-testsuite "$suite"
|
||||
fact-add phoronix-testdir "$PTSDIR"
|
||||
|
||||
juju-log "confirm benchmark settings"
|
||||
juju-log "archive: $(facter phoronix-archive)"
|
||||
juju-log "suite: $(facter phoronix-testsuite)"
|
||||
juju-log "dir: $(facter phoronix-testdir)"
|
||||
}
|
||||
|
||||
case $COMMAND in
|
||||
install)
|
||||
install_phoronix
|
||||
;;
|
||||
start)
|
||||
juju-log "starting phoronix is a nop, use the upstart job"
|
||||
;;
|
||||
stop)
|
||||
juju-log "starting phoronix is a nop, use the upstart job"
|
||||
;;
|
||||
config-changed)
|
||||
config_changed_phoronix
|
||||
;;
|
||||
upgrade-charm)
|
||||
install_phoronix
|
||||
;;
|
||||
*)
|
||||
juju-log "command not recognized"
|
||||
esac
|
||||
|
||||
exit 0
|
||||
1
deploy/juju/trusty/pts/hooks/start
Symbolic link
1
deploy/juju/trusty/pts/hooks/start
Symbolic link
@@ -0,0 +1 @@
|
||||
phoronix-common
|
||||
1
deploy/juju/trusty/pts/hooks/stop
Symbolic link
1
deploy/juju/trusty/pts/hooks/stop
Symbolic link
@@ -0,0 +1 @@
|
||||
phoronix-common
|
||||
1
deploy/juju/trusty/pts/hooks/upgrade-charm
Symbolic link
1
deploy/juju/trusty/pts/hooks/upgrade-charm
Symbolic link
@@ -0,0 +1 @@
|
||||
phoronix-common
|
||||
6
deploy/juju/trusty/pts/metadata.yaml
Normal file
6
deploy/juju/trusty/pts/metadata.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: pts
|
||||
maintainer: Adam Israel <adam.israel@canonical.com>
|
||||
summary: The Phoronix Test Suite
|
||||
description: |
|
||||
Installs phoronix-test-suite and provides simple interface to enable
|
||||
individual stress tests and runs them via upstart job
|
||||
1
deploy/juju/trusty/pts/revision
Normal file
1
deploy/juju/trusty/pts/revision
Normal file
@@ -0,0 +1 @@
|
||||
15
|
||||
50
deploy/juju/trusty/pts/scripts/parse
Executable file
50
deploy/juju/trusty/pts/scripts/parse
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
|
||||
import subprocess
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
# Description keys to strip for multi-test readability
|
||||
strips = ['Test: ', 'Type: ', 'PHP Benchmark Suite', ' ']
|
||||
|
||||
|
||||
def action_set(key, val):
|
||||
action_cmd = ['action-set']
|
||||
key = key.strip().replace(' ', '-')
|
||||
|
||||
if isinstance(val, dict):
|
||||
for k, v in val.iteritems():
|
||||
k = k.strip().replace(' ', '-')
|
||||
action_set('%s.%s' % (key, k), v)
|
||||
return
|
||||
|
||||
action_cmd.append('%s=%s' % (key, val))
|
||||
subprocess.check_call(action_cmd)
|
||||
|
||||
|
||||
test_file = sys.argv[1]
|
||||
|
||||
if not os.path.isfile(test_file):
|
||||
sys.exit(1)
|
||||
|
||||
tree = ET.parse(test_file)
|
||||
root = tree.getroot()
|
||||
|
||||
for result in root.iter('Result'):
|
||||
desc = result.find('Description').text
|
||||
for s in strips:
|
||||
desc = desc.replace(s, '')
|
||||
|
||||
test = result.find('Title').text.lower()
|
||||
desc = re.sub(r'[\W]', '-', desc.lower())
|
||||
value = result.find('Data').find('Entry').find('Value').text
|
||||
units = result.find('Scale').text
|
||||
|
||||
print(test, desc, value, units)
|
||||
key = 'results.%s-%s' % (test, desc) if desc else 'results.%s' % test
|
||||
action_set(key, {'value': value, 'units': units})
|
||||
@@ -1,6 +1,7 @@
|
||||
[Unit]
|
||||
Description=Phoronix Test Suite Phoromatic Client
|
||||
After=syslog.target network-online.target
|
||||
Documentation=man:phoronix-test-suite(1)
|
||||
|
||||
[Service]
|
||||
TimeoutStartSec=300
|
||||
@@ -1,6 +1,7 @@
|
||||
[Unit]
|
||||
Description=Phoronix Test Suite Phoromatic Server
|
||||
After=syslog.target network.target
|
||||
Documentation=man:phoronix-test-suite(1)
|
||||
|
||||
[Service]
|
||||
TimeoutStartSec=300
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008, Andrew Schofield
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -23,7 +23,7 @@
|
||||
if(!is_file("phoronix-test-suite") || !is_dir("pts-core/"))
|
||||
{
|
||||
echo "\nYou must run this script from the root directory of the phoronix-test-suite/ folder!\n";
|
||||
echo "Example: php5 pts-core/scripts/package-build-rpm.php\n";
|
||||
echo "Example: php5 deploy/rpm-package/build-package-rpm.php\n";
|
||||
exit(0);
|
||||
}
|
||||
if(!is_executable('/usr/bin/rpmbuild'))
|
||||
@@ -40,19 +40,21 @@ if(!defined("PTS_VERSION"))
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$rpm_v = PTS_VERSION . '.' . date('YmdHi');
|
||||
|
||||
shell_exec("rm -rf /tmp/pts-rpm-builder/");
|
||||
shell_exec("mkdir -p /tmp/pts-rpm-builder/{BUILD,RPMS,S{OURCE,PEC,RPM}S,phoronix-test-suite-" . PTS_VERSION . "}");
|
||||
shell_exec("cp -R ./ /tmp/pts-rpm-builder/phoronix-test-suite-" . PTS_VERSION . "/");
|
||||
shell_exec("tar --exclude=.git -C /tmp/pts-rpm-builder/ -cjvf /tmp/pts-rpm-builder/SOURCES/phoronix-test-suite-" . PTS_VERSION . ".tar.bz2 phoronix-test-suite-" . PTS_VERSION . "/");
|
||||
shell_exec("mkdir -p /tmp/pts-rpm-builder/{BUILD,RPMS,S{OURCE,PEC,RPM}S,phoronix-test-suite-" . $rpm_v . "}");
|
||||
shell_exec("cp -R ./ /tmp/pts-rpm-builder/phoronix-test-suite-" . $rpm_v . "/");
|
||||
shell_exec("tar --exclude=.git -C /tmp/pts-rpm-builder/ -cjvf /tmp/pts-rpm-builder/SOURCES/phoronix-test-suite-" . $rpm_v . ".tar.bz2 phoronix-test-suite-" . $rpm_v . "/");
|
||||
|
||||
$spec_file = "Summary: A Comprehensive Linux Benchmarking System\n";
|
||||
$spec_file .= "Name: phoronix-test-suite\n";
|
||||
$spec_file .= "Version: " . PTS_VERSION . "\n";
|
||||
$spec_file .= "Version: " . $rpm_v . "\n";
|
||||
$spec_file .= "Release: 1\n";
|
||||
$spec_file .= "License: GPL\n";
|
||||
$spec_file .= "Group: Utilities\n";
|
||||
$spec_file .= "URL: http://www.phoronix-test-suite.com/\n";
|
||||
$spec_file .= "Source: phoronix-test-suite-" . PTS_VERSION . ".tar.bz2\n";
|
||||
$spec_file .= "Source: phoronix-test-suite-" . $rpm_v . ".tar.bz2\n";
|
||||
$spec_file .= "Packager: Phoronix Media <trondheim-pts@phoronix-test-suite.com>\n";
|
||||
$spec_file .= "Requires: php-cli, php-xml\n";
|
||||
$spec_file .= "BuildArch: noarch\n";
|
||||
@@ -87,7 +89,7 @@ file_put_contents("/tmp/pts-rpm-builder/SPECS/pts.spec", $spec_file);
|
||||
shell_exec("mv -f " . getenv('HOME') . "/.rpmmacros /tmp/pts-rpm-builder 2>&1");
|
||||
file_put_contents(getenv('HOME') ."/.rpmmacros", "%_topdir /tmp/pts-rpm-builder");
|
||||
shell_exec("rpmbuild -ba --verbose /tmp/pts-rpm-builder/SPECS/pts.spec");
|
||||
shell_exec("cp /tmp/pts-rpm-builder/RPMS/noarch/phoronix-test-suite-" . PTS_VERSION . "-1.noarch.rpm ./");
|
||||
shell_exec("cp /tmp/pts-rpm-builder/RPMS/noarch/phoronix-test-suite-" . $rpm_v . "-1.noarch.rpm ./");
|
||||
shell_exec("rm -f " . getenv('HOME') . "/.rpmmacros");
|
||||
shell_exec("mv -f /tmp/pts-rpm-builder/.rpmmacros " . getenv('HOME') . ' 2>1');
|
||||
shell_exec("rm -rf /tmp/pts-rpm-builder");
|
||||
@@ -17,20 +17,18 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
|
||||
### PTS-GRAPH ###
|
||||
|
||||
- Improve rendering of large data-sets, e.g. http://openbenchmarking.org/result/1205231-LI-BL460G6BE41
|
||||
- Rotated text alignment for some PNG graphixs is sometimes off by 90/180 degrees compared to SVG, e.g. http://openbenchmarking.org/s/Compiler
|
||||
- SVG graph improvements
|
||||
|
||||
### OPENBENCHMARKING.ORG ###
|
||||
|
||||
- Shorten long change-logs on test profile pages - e.g. http://openbenchmarking.org/test/pts/hpcc
|
||||
[ REST SUBJECT TO PHORONIX MEDIA NDA ]
|
||||
|
||||
### NEW TEST PROFILES ###
|
||||
|
||||
- Python-libmemcached [http://code.google.com/p/python-libmemcached/]
|
||||
- Intel HiBench [https://github.com/intel-hadoop/HiBench]
|
||||
- Hadoop Benchmarks
|
||||
- Hadoop Benchmarks / TeraSort
|
||||
- LATT Latency Tests [git://git.kernel.dk/latt.git]
|
||||
- QMC Beaver [http://qmcbeaver.sourceforge.net/]
|
||||
- Some potential interesting GPGPU tests [http://www.bealto.com/gpu-benchmarks.html]
|
||||
@@ -41,7 +39,9 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
- http://hashcat.net/oclhashcat/
|
||||
- Handbrake [http://handbrake.fr/]
|
||||
- libMicro [https://github.com/portante/libMicro]
|
||||
- http://markjstock.org/pages/rad_bench.html
|
||||
- https://code.google.com/p/pyrit/
|
||||
- https://github.com/acangiano/ruby-benchmark-suite
|
||||
- http://www.nwchem-sw.org/index.php/Compiling_NWChem
|
||||
- http://sourceforge.net/projects/ffsb/
|
||||
- http://www.ratgpu.com/
|
||||
@@ -52,8 +52,14 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
- http://www.capsl.udel.edu/splash/Download.html
|
||||
- https://github.com/facebook/linkbench
|
||||
- https://github.com/vasi/pixz
|
||||
- stephentu/silo
|
||||
- http://nondot.org/sabre/LLVMNotes/#benchmarks
|
||||
- https://code.google.com/p/smhasher/wiki/SMHasher
|
||||
- http://benchmarksgame.alioth.debian.org/u32/performance.php?test=fasta / http://benchmarksgame.alioth.debian.org/u32/program.php?test=nbody&lang=gcc&id=1#sourcecode
|
||||
- https://openfoamwiki.net/index.php/Benchmarks_standard_v1
|
||||
- Cassandra 1.2 stress - http://docs.datastax.com/en/cassandra/1.2/cassandra/tools/toolsCStress_t.html
|
||||
- http://gcc.opensuse.org/c++bench-frescobaldi/
|
||||
|
||||
|
||||
### WEB SOCKET / HTML5 USER INTERFACE WORK ###
|
||||
|
||||
@@ -65,7 +71,6 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
|
||||
### PHOROMATIC ####
|
||||
|
||||
- Get the Phoromatic search box implemented/working
|
||||
- Implement the complementary WebSocket communication to HTTP pulls
|
||||
- More mobile form factor optimizations
|
||||
- Ensure sane validating of more user input / resource uploads
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH phoronix-test-suite 1 "www.phoronix-test-suite.com" "5.4.0"
|
||||
.TH phoronix-test-suite 1 "www.phoronix-test-suite.com" "5.8.1"
|
||||
.SH NAME
|
||||
phoronix-test-suite \- The Phoronix Test Suite is an extensible open-source platform for performing testing and performance evaluation.
|
||||
.SH SYNOPSIS
|
||||
@@ -6,12 +6,12 @@ phoronix-test-suite \- The Phoronix Test Suite is an extensible open-source plat
|
||||
.br
|
||||
.B phoronix-test-suite benchmark [test | suite]
|
||||
.SH DESCRIPTION
|
||||
The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.
|
||||
The **Phoronix Test Suite** is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.SH TEST INSTALLATION
|
||||
.B install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
This option will install the selected test(s) inside the testing environment directory). The install process from downloading of the test files to the installation is fully automated. The install option needs to be supplied with the test name or suite as an argument. Optionally, a OpenBenchmarking.org ID or the name of a saved results file can be supplied as well and the test(s) to install will automatically be extracted from that information. If the test is already installed and was run by the latest version of the installation process, no action will be taken. Multiple arguments can be supplied to install additional tests at the same time.
|
||||
This option will install the selected test(s) inside the testing environment directory. The install process from downloading of the test files to the installation is fully automated. The install option needs to be supplied with the test name or suite as an argument. Optionally, a OpenBenchmarking.org ID or the name of a saved results file can be supplied as well and the test(s) to install will automatically be extracted from that information. If the test is already installed and was run by the latest version of the installation process, no action will be taken. Multiple arguments can be supplied to install additional tests at the same time.
|
||||
.TP
|
||||
.B install-dependencies [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
This option will install the external dependencies needed by the selected test(s) using the distribution's package management system. For example, some tests depend upon GCC for compiling code. If GCC is not detected on the system, the Phoronix Test Suite will attempt to install GCC using the distribution's package management system. If you are running this command as a local user, you may be prompted for the root password while the process is running. For unsupported distributions, the dependency names will be displayed along with common names for the package. The install-dependencies option needs to be supplied with the test name or suite as an argument. When using the install option, the external dependencies are automatically checked.
|
||||
@@ -41,6 +41,9 @@ This option will query OpenBenchmarking.org to run random benchmarks and result
|
||||
.B run-tests-in-suite
|
||||
This option can be used if you wish to run all of the tests found in a supplied suite, but you wish to re-configure each of the test options rather than using the defaults supplied by the suite.
|
||||
.TP
|
||||
.B stress-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
This option will run the passed tests/suites in the multi-process stress-testing mode. The stress-run mode will not produce a result file but is rather intended for running multiple test profiles concurrently to stress / burn-in the system. The number of tests to run concurrently can be toggled via the PTS_CONCURRENT_TEST_RUNS environment variable and by default is set to a value of 2.
|
||||
.TP
|
||||
.SH BATCH TESTING
|
||||
.B batch-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
This option and its arguments are equivalent to the benchmark option, but the process will be run in the Phoronix Test Suite batch mode.
|
||||
@@ -215,6 +218,9 @@ This option is used if you wish to manually change the order in which test resul
|
||||
.B result-file-to-csv [Test Result]
|
||||
This option will read a saved test results file and output the system hardware and software information along with the results to a CSV output. The CSV (Comma Separated Values) output can then be loaded into a spreadsheet for easy viewing.
|
||||
.TP
|
||||
.B result-file-to-json [Test Result]
|
||||
This option will read a saved test results file and output the basic result information to JSON (JavaScript Object Notation).
|
||||
.TP
|
||||
.B result-file-to-pdf [Test Result]
|
||||
This option will read a saved test results file and output the system hardware and software information along with the results to a PDF file.
|
||||
.TP
|
||||
@@ -241,6 +247,9 @@ This option will guide the user through the process of generating their own test
|
||||
.B debug-self-test
|
||||
This option is used during the development of the Phoronix Test Suite software for testing of internal interfaces, commands, and other common code-paths. The produced numbers should only be comparable for the same version of the Phoronix Test Suite, on the same hardware/software system, conducted on the same day of testing. This isn't intended as any scientific benchmark but simply to stress common PHP code-paths and looking for hot areas to optimize, etc.
|
||||
.TP
|
||||
.B enterprise-setup
|
||||
This option can be run by enterprise users immediately after package installation or as part of an in-house setup script. Running this command will ensure the phoronix-test-suite program is never interrupted on new runs to accept user agreement changes and defaults the anonymous usage reporting to being disabled and other conservative defaults.
|
||||
.TP
|
||||
.B help
|
||||
This option will display the list of available Phoronix Test Suite commands.
|
||||
.TP
|
||||
@@ -267,7 +276,7 @@ Launch the Phoronix Test Suite HTML5 web user-interface in the local GUI mode (n
|
||||
Start the GUI web server and WebSocket server processes for remote (or local) access via the web-browser. The settings can be configured via the Phoronix Test Suite's XML configuration file.
|
||||
.TP
|
||||
.B start-ws-server
|
||||
Manually start a WebSocket server for communication by remote Phoronix Test Suite GUIs, the Phoronix Test Suite Multi-System Commander, and other functionality.
|
||||
Manually start a WebSocket server for communication by remote Phoronix Test Suite GUIs, the Phoronix Test Suite Multi-System Commander, and other functionality. This function checks the PTS_WEBSOCKET_PORT and PTS_WEBSOCKET_SERVER environment variables for configuration.
|
||||
.TP
|
||||
.SH MODULES
|
||||
.B list-modules
|
||||
@@ -282,9 +291,9 @@ This option will allow you to configure all available end-user options for a Pho
|
||||
.B test-module [Phoronix Test Suite Module]
|
||||
This option can be used for debugging a Phoronix Test Suite module.
|
||||
.TP
|
||||
.SH GUI / WEB SUPPORT
|
||||
.B s
|
||||
t
|
||||
.SH PHOROMATIC
|
||||
.B g
|
||||
n
|
||||
.TP
|
||||
.SH SEE ALSO
|
||||
.B Websites:
|
||||
@@ -299,5 +308,5 @@ http://www.phoronix.com/
|
||||
.br
|
||||
http://www.phoronix.com/forums/
|
||||
.SH AUTHORS
|
||||
Copyright 2008 - 2014 by Phoronix Media, Michael Larabel.
|
||||
Copyright 2008 - 2015 by Phoronix Media, Michael Larabel.
|
||||
.TP
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Phoromatic Server</h1>
|
||||
<p><em>This documentation is a work-in-progress and will be firmed up by the Phoronix Test Suite 5.4 official release planned for November 2014.</em></p>
|
||||
<h2>Introduction</h2>
|
||||
<p>Phoromatic is a remote management system for the Phoronix Test Suite. Phoromatic allows the automatic (hence the name <em>Phoro-matic</em>) scheduling of tests, remote installation of new tests, and the management of multiple test systems all through an intuitive, easy-to-use web interface. Tests can be scheduled to automatically run on a routine basis across multiple test systems. The test results are then available from this central, secure location.</p>
|
||||
<p>Phoromatic was originally introduced with Phoronix Test Suite 2.0 via Phoromatic.com as a project going back to 2008~2009. Phoromatic.com debuted as a hosted instance with the option of behind-the-firewall licensing for use within organizations. With Phoronix Test Suite 5.2 the model shifted to offer a local, open-source version of Phoromatic built into the Phoronix Test Suite code-base. Thanks to continued enterprise development, with Phoronix Test Suite 5.4 is now a fully-functioning, built-in version of Phoromatic that's open-source and can be used for behind-the-firewall testing without needing to push results to OpenBenchmarking.org and the ability to keep all results private.</p>
|
||||
@@ -73,7 +72,7 @@ SUPPORTED OPENBENCHMARKING.ORG REPOSITORIES:<br />
|
||||
<h3>Ports / Services</h3>
|
||||
<p>The Phoromatic Server process currently relies upon a PHP/HHVM built-in web server process and a PTS-hosted WebSocket server. The web server process handles the web UI and much of the responsibilities of the Phoromatic Server. Over time the PTS WebSocket server will be increasingly utilized for bi-directional, real-time communication between the server and clients -- including for features like viewing real-time hardware sensors of client systems from the server UI.</p>
|
||||
<h3>Systemd / Upstart</h3>
|
||||
<p>Packaged with the Phoronix Test Suite are basic <em>phoromatic-client</em> and <em>phoromatic-server</em> configurations for both Upstart and systemd init systems. The <em>phoromatic-server</em> configuration will launch the Phoronix Test Suite's Phoromatic Server and the <em>phoromatic-client</em> service will attempt to connect to a <u>pre-configured</u> Phoromatic Server. The systemd service files will automatically be installed via the Phoronix Test Suite <em>install-sh</em> process while the Upstart jobs can be copied from <em>pts-core/static/upstart/*</em> to <em>/etc/init</em>.</p>
|
||||
<p>Packaged with the Phoronix Test Suite are basic <em>phoromatic-client</em> and <em>phoromatic-server</em> configurations for both Upstart and systemd init systems. The <em>phoromatic-server</em> configuration will launch the Phoronix Test Suite's Phoromatic Server and the <em>phoromatic-client</em> service will attempt to connect to a <u>pre-configured</u> Phoromatic Server. The systemd service files will automatically be installed via the Phoronix Test Suite <em>install-sh</em> process while the Upstart jobs can be copied from <em>deploy/phoromatic-upstart/*</em> to <em>/etc/init</em>.</p>
|
||||
<h3>Cache Verification</h3>
|
||||
<p>To confirm the files accessible to Phoronix Test Suite client systems, from the Phoromatic Server web user-interface go to the <em>settings</em> page followed by the <em>cache settings</em> link to view information about the download and OpenBenchmarking.org caches. From the client systems, running <strong>phoronix-test-suite phoromatic.explore</strong> will also supply cache statistics.</p>
|
||||
<h3>Log Files</h3>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Module Options</title></head><body><p>The following list is the modules included with the Phoronix Test Suite that are intended to extend the functionality of pts-core. Some of these options have commands that can be run directly in a similiar manner to the other Phoronix Test Suite user commands. Some modules are just meant to be loaded directly by adding the module name to the LoadModules tag in ~/.phoronix-test-suite/user-config.xml or via the PTS_MODULES environmental variable. A list of available modules is also available by running <em>phoronix-test-suite list-modules.</em><hr></p><h2>Dummy Module</h2><p>This is a simple module intended for developers to just demonstrate some of the module functions.</p><p>phoronix-test-suite dummy_module.dummy-command</p><h2>OpenBenchmarking.org Ekofisk</h2><p>The Ekofisk client is used for connecting to OpenBenchmarking.org to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner.</p><p>phoronix-test-suite ekofisk.start</p><p>phoronix-test-suite ekofisk.user-system-return</p><h2>Graphics Event Checker</h2><p>This module checks a number of events prior to and and after running a test to make sure the graphics sub-system was not put in a sour or unintended state by the application. For instance, it makes sure syncing to vBlank is not forced through the driver and that a graphics test has not left the display in an unintended mode.</p><h2>Graphics Override</h2><p>This module allows you to override some graphics rendering settings for the ATI and NVIDIA drivers while running the Phoronix Test Suite.</p><p>This module utilizes the following environmental variables: FORCE_AA, FORCE_AF.</p><h2>MATISK</h2><p>My Automated Test Infrastructure Setup Kit</p><p>phoronix-test-suite matisk.run</p><p>phoronix-test-suite matisk.template</p><h2>Phoromatic Client</h2><p>The Phoromatic client is used for connecting to a Phoromatic server (Phoromatic.com or a locally run server) to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner. For more details visit http://www.phoromatic.com/. This module is intended to be used with Phoronix Test Suite 5.2+ clients and servers.</p><p>phoronix-test-suite phoromatic.connect</p><p>phoronix-test-suite phoromatic.explore</p><p>phoronix-test-suite phoromatic.upload-result</p><p>phoronix-test-suite phoromatic.set-root-admin-password</p><h2>Pushover.net</h2><p>Submit notifications to your iOS/Android mobile devices of test results in real-time as push notifications, etc. Using the Pushover.net API.</p><p>This module utilizes the following environmental variables: PUSHOVER_NET_USER.</p><h2>Result Notifier</h2><p>A notification module.</p><h2>System Monitor</h2><p>This module contains sensor monitoring support.</p><p>This module utilizes the following environmental variables: MONITOR, PERFORMANCE_PER_WATT, MONITOR_INTERVAL.</p><h2>Timed Screenshot</h2><p>This is a module that will take a screenshot of the system at a pre-defined interval. ImageMagick must be installed onto the system prior to using this module.</p><p>This module utilizes the following environmental variables: SCREENSHOT_INTERVAL.</p><h2>Toggle Screensaver</h2><p>This module toggles the system's screensaver while the Phoronix Test Suite is running. At this time, the GNOME and KDE screensavers are supported.</p><p>This module utilizes the following environmental variables: HALT_SCREENSAVER.</p><h2>Update Checker</h2><p>This module checks to see if the Phoronix Test Suite -- and its tests and suites -- are up to date.</p></body></html>
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Module Options</title></head><body><p>The following list is the modules included with the Phoronix Test Suite that are intended to extend the functionality of pts-core. Some of these options have commands that can be run directly in a similiar manner to the other Phoronix Test Suite user commands. Some modules are just meant to be loaded directly by adding the module name to the LoadModules tag in ~/.phoronix-test-suite/user-config.xml or via the PTS_MODULES environmental variable. A list of available modules is also available by running <em>phoronix-test-suite list-modules.</em><hr></p><h2>Dummy Module</h2><p>This is a simple module intended for developers to just demonstrate some of the module functions.</p><p>phoronix-test-suite dummy_module.dummy-command</p><h2>OpenBenchmarking.org Ekofisk</h2><p>The Ekofisk client is used for connecting to OpenBenchmarking.org to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner.</p><p>phoronix-test-suite ekofisk.start</p><p>phoronix-test-suite ekofisk.user-system-return</p><h2>Graphics Event Checker</h2><p>This module checks a number of events prior to and and after running a test to make sure the graphics sub-system was not put in a sour or unintended state by the application. For instance, it makes sure syncing to vBlank is not forced through the driver and that a graphics test has not left the display in an unintended mode.</p><h2>Graphics Override</h2><p>This module allows you to override some graphics rendering settings for the ATI and NVIDIA drivers while running the Phoronix Test Suite.</p><p>This module utilizes the following environmental variables: FORCE_AA, FORCE_AF.</p><h2>MATISK</h2><p>My Automated Test Infrastructure Setup Kit</p><p>phoronix-test-suite matisk.run</p><p>phoronix-test-suite matisk.template</p><h2>Phoromatic Client</h2><p>The Phoromatic client is used for connecting to a Phoromatic server (Phoromatic.com or a locally run server) to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner. For more details visit http://www.phoromatic.com/. This module is intended to be used with Phoronix Test Suite 5.2+ clients and servers.</p><p>phoronix-test-suite phoromatic.connect</p><p>phoronix-test-suite phoromatic.explore</p><p>phoronix-test-suite phoromatic.upload-result</p><p>phoronix-test-suite phoromatic.set-root-admin-password</p><p>phoronix-test-suite phoromatic.list-results</p><p>phoronix-test-suite phoromatic.clone</p><p>phoronix-test-suite phoromatic.export-results-for-account-schedules</p><h2>Pushover.net</h2><p>Submit notifications to your iOS/Android mobile devices of test results in real-time as push notifications, etc. Using the Pushover.net API.</p><p>This module utilizes the following environmental variables: PUSHOVER_NET_USER.</p><h2>Result Notifier</h2><p>A notification module.</p><h2>System Monitor</h2><p>This module contains sensor monitoring support.</p><p>This module utilizes the following environmental variables: MONITOR, PERFORMANCE_PER_WATT, MONITOR_INTERVAL.</p><h2>Timed Screenshot</h2><p>This is a module that will take a screenshot of the system at a pre-defined interval. ImageMagick must be installed onto the system prior to using this module.</p><p>This module utilizes the following environmental variables: SCREENSHOT_INTERVAL.</p><h2>Toggle Screensaver</h2><p>This module toggles the system's screensaver while the Phoronix Test Suite is running. At this time, the GNOME and KDE screensavers are supported.</p><p>This module utilizes the following environmental variables: HALT_SCREENSAVER.</p><h2>Update Checker</h2><p>This module checks to see if the Phoronix Test Suite -- and its tests and suites -- are up to date.</p></body></html>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<p><strong>PTS_DISPLAY_MODE</strong></p>
|
||||
<p>If you wish to load a non-default display mode for a single instance, specify the mode in this variable.</p>
|
||||
<p><strong>TOTAL_LOOP_TIME</strong></p>
|
||||
<p>When running any test(s), if you would like the test(s) to continue running as a loop until a certain time has been reached, this variable can be used. The value should be the number of minutes to run the testing process before the loop is ended.</p>
|
||||
<p>When running any test(s), if you would like the test(s) to continue running as a loop until a certain time has been reached, this variable can be used. The value should be the number of minutes to run the testing process before the loop is ended. The testing will finish whenever the currently active test has finished once the time has elapsed. The minimum value allowed is 10 minutes.</p>
|
||||
<p><strong>LIMIT_ELAPSED_TEST_TIME</strong></p>
|
||||
<p>If you want to ensure that the time for a given Phoronix Test Suite process doesn't elapse past a certain number of minutes, specify the number of minutes for this environment variable. When the amount of time spent testing exceeds that amount, the testing will end prematurely while still saving the tests that were completed in time.</p>
|
||||
<p><strong>TOTAL_LOOP_COUNT</strong></p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Title>Development Credits</Title>
|
||||
</head>
|
||||
<body>
|
||||
<p>The Phoronix Test Suite is based upon the extensive testing and internal tools developed by <a href="http://www.phoronix.com/">Phoronix.com</a> since 2004 along with support from leading tier-one computer hardware and software vendors. The principal architects of the Phoronix Test Suite are <a href="http://www.michaellarabel.com/">Michael Larabel</a> and Matthew Tippett. The phoronix-test-suite, pts_Graph, bilde_renderer, Phodevi, tandem_Xml, and nye_Xml are some of the related open-source projects provided by <a href="http://www.phoronix-media.com/">Phoronix Media</a>.</p>
|
||||
<p>The Phoronix Test Suite is based upon the extensive testing and internal tools developed by <a href="http://www.phoronix.com/">Phoronix.com</a> since 2004 along with support from leading tier-one computer hardware and software vendors. The principal architects of the Phoronix Test Suite are <a href="http://www.michaellarabel.com/">Michael Larabel</a> and Matthew Tippett. The phoronix-test-suite, pts_Graph, Phoromatic, Phodevi, tandem_Xml, and nye_Xml are some of the related open-source projects provided by <a href="http://www.phoronix-media.com/">Phoronix Media</a>.</p>
|
||||
<p>Below is a list of individuals and organizations that have contributed upstream patches, test profiles, and/or made other contributions to the Phoronix Test Suite that Phoronix Media would like to thank.</p>
|
||||
<ul>
|
||||
<li>Achim Gottinger</li>
|
||||
|
||||
@@ -2,26 +2,24 @@ The Phoronix Test Suite itself is an open-source framework for conducting automa
|
||||
|
||||
This framework is designed to be an extensible architecture so that new test profiles and suites can be easily added to represent performance benchmarks, unit tests, and other quantitative and qualitative (e.g. image quality comparison) measurements. Available through OpenBenchmarking.org, a collaborative storage platform developed in conjunction with the Phoronix Test Suite, are more than 200 individual test profiles and more than 60 test suites available by default from the Phoronix Test Suite. Independent users are also able to upload their test results, profiles, and suites to OpenBenchmarking.org. A test profile is a single test that can be executed by the Phoronix Test Suite -- with a series of options possible within every test -- and a test suite is a seamless collection of test profiles and/or additional test suites. A test profile consists of a set of bash/shell scripts and XML files while a test suite is a single XML file.
|
||||
|
||||
OpenBenchmarking.org <http://www.openbenchmarking.org/> also allows for conducting side-by-side result comparisons, a central location for storing and sharing test results, and collaborating over test data. Phoromatic <http://www.phoromatic.com/> is a complementary platform to OpenBenchmarking.org and the Phoronix Test Suite for interfacing with Phoronix Test Suite client(s) to automatically execute test runs on a timed, per-commit, or other trigger-driven basis. Phoromatic is designed for enterprise and allows for the easy management of multiple networked systems running Phoronix Test Suite clients via a single web-based interface.
|
||||
[OpenBenchmarking.org](http://www.openbenchmarking.org/) also allows for conducting side-by-side result comparisons, a central location for storing and sharing test results, and collaborating over test data. [Phoromatic](http://www.phoromatic.com/) is a complementary platform to OpenBenchmarking.org and the Phoronix Test Suite for interfacing with Phoronix Test Suite client(s) to automatically execute test runs on a timed, per-commit, or other trigger-driven basis. Phoromatic is designed for enterprise and allows for the easy management of multiple networked systems running Phoronix Test Suite clients via a single web-based interface.
|
||||
|
||||
Professional support and custom engineering for the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org is available by contacting <http://www.phoronix-test-suite.com/>.
|
||||
|
||||
Full details on the Phoronix Test Suite setup and usage is available from the included HTML/PDF documentation within the phoronix-test-suite package and from the Phoronix Test Suite web-site.
|
||||
|
||||
INSTALLATION & SETUP:
|
||||
#####################
|
||||
## INSTALLATION & SETUP:
|
||||
|
||||
The Phoronix Test Suite is supported on Linux, *BSD, Solaris, Mac OS X, and Windows systems. However, the most full-featured and well supported operating system for conducting the tests is Linux with some non-basic functionality not being available under all platforms. The Phoronix Test Suite software/framework is compatible with all major CPU architectures (e.g. i686, x86_64, ARM, PowerPC), but not all of the test profiles/suites are compatible with all architectures.
|
||||
|
||||
The Phoronix Test Suite can be installed for system-wide usage or run locally without installation from the extracted tar.gz/zip package. The only hard dependency on the Phoronix Test Suite is having command-line support for PHP (PHP 5.2+) installed. A complete PHP stack (e.g. with web-server) is NOT needed, but merely the PHP command-line support, which is widely available from operating system package managers under the name php, php5-cli, or php5.
|
||||
The Phoronix Test Suite can be installed for system-wide usage or run locally without installation from the extracted tar.gz/zip package. The only hard dependency on the Phoronix Test Suite is having command-line support for PHP (PHP 5.2+) installed. A complete PHP stack (e.g. with web-server) is NOT needed, but merely the PHP command-line support, which is widely available from operating system package managers under the name `php`, `php5-cli`, or `php5`.
|
||||
|
||||
USAGE:
|
||||
######
|
||||
## USAGE:
|
||||
|
||||
The process to download, install/setup, execute, and report the results of a benchmark can be as simple as a command such as *phoronix-test-suite benchmark smallpt* to run a simple CPU test profile. If wishing to simply install a test, it's a matter of running *phoronix-test-suite install <test or suite name>* and to run it's *phoronix-test-suite run <test or suite name>*. There's also a batch mode for non-interactive benchmarking by first running *phoronix-test-suite batch-setup* and then using the *batch-run* sub-command rather than *run*.
|
||||
The process to download, install/setup, execute, and report the results of a benchmark can be as simple as a command such as `phoronix-test-suite benchmark smallpt` to run a simple CPU test profile. If wishing to simply install a test, it's a matter of running `phoronix-test-suite install <test or suite name>` and to run it's `phoronix-test-suite run <test or suite name>`. There's also a batch mode for non-interactive benchmarking by first running `phoronix-test-suite batch-setup` and then using the `batch-run` sub-command rather than `run`.
|
||||
|
||||
Viewing installed system hardware and software is available via *phoronix-test-suite system-info* or *phoronix-test-suite detailed-system-info* for greater verbosity.
|
||||
Viewing installed system hardware and software is available via `phoronix-test-suite system-info` or `phoronix-test-suite detailed-system-info` for greater verbosity.
|
||||
|
||||
Facilitating a result comparison from OpenBenchmarking.org can be done by running, for example, *phoronix-test-suite benchmark 1204293-BY-PHORONIX357* if wishing to compare the results of the *http://openbenchmarking.org/result/1204293-BY-PHORONIX357* result file.
|
||||
Facilitating a result comparison from OpenBenchmarking.org can be done by running, for example, `phoronix-test-suite benchmark 1204293-BY-PHORONIX357` if wishing to compare the results of the `http://openbenchmarking.org/result/1204293-BY-PHORONIX357` result file.
|
||||
|
||||
Additional information is available from the Phoronix Test Suite web-site <http://www.phoronix-test-suite.com/> and the material bundled within the phoronix-test-suite/documentation/ directory. A man page is also bundled with the phoronix-test-suite software.
|
||||
Additional information is available from the Phoronix Test Suite web-site <http://www.phoronix-test-suite.com/> and the material bundled within the `phoronix-test-suite/documentation/` directory. A man page is also bundled with the phoronix-test-suite software.
|
||||
|
||||
14
install-sh
14
install-sh
@@ -2,7 +2,7 @@
|
||||
|
||||
# Phoronix Test Suite
|
||||
# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
# Copyright (C) 2008 - 2014, Phoronix Media
|
||||
# Copyright (C) 2008 - 2015, Phoronix Media
|
||||
#
|
||||
# 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
|
||||
@@ -42,7 +42,7 @@ fi
|
||||
mkdir -p $DESTDIR$INSTALL_PREFIX
|
||||
if [ ! -w $DESTDIR$INSTALL_PREFIX ]
|
||||
then
|
||||
echo "\nERROR: $DESTDIR$INSTALL_PREFIX is not writable. Run this installer as root or specify a different directory prefix as the first argument sent to this script.\n"
|
||||
echo "ERROR: $DESTDIR$INSTALL_PREFIX is not writable. Run this installer as root or specify a different directory prefix as the first argument sent to this script."
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -60,7 +60,7 @@ mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/bash_completion.d/
|
||||
#mkdir -p $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
|
||||
#mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
|
||||
|
||||
cp CHANGE-LOG $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
|
||||
cp ChangeLog $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
|
||||
cp COPYING $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
|
||||
cp AUTHORS $DESTDIR$INSTALL_PREFIX/share/doc/phoronix-test-suite/
|
||||
|
||||
@@ -77,14 +77,14 @@ cp pts-core/static/phoronix-test-suite-launcher.desktop $DESTDIR$INSTALL_PREFIX/
|
||||
cp pts-core/static/phoronix-test-suite.appdata.xml $DESTDIR$INSTALL_PREFIX/share/appdata/
|
||||
|
||||
mkdir -p $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
|
||||
cp pts-core/static/*.service $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
|
||||
cp deploy/*-systemd/*.service $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
|
||||
|
||||
# mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
|
||||
# cp pts-core/static/upstart/*.conf $DESTDIR$INSTALL_PREFIX/../etc/init/
|
||||
|
||||
|
||||
rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts/etc/scripts/package-build-*
|
||||
rm -rf $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core
|
||||
cp -r pts-core $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
|
||||
cp -r deploy $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/
|
||||
rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/static/phoronix-test-suite.desktop
|
||||
rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/static/phoronix-test-suite-launcher.desktop
|
||||
rm -f $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/openbenchmarking.org/openbenchmarking-mime.xml
|
||||
@@ -99,7 +99,7 @@ chmod +x $DESTDIR$INSTALL_PREFIX/bin/phoronix-test-suite
|
||||
# sed 's:\$url = PTS_PATH . \"documentation\/index.html\";:\$url = \"'"$INSTALL_PREFIX"'\/share\/doc\/packages\/phoronix-test-suite\/index.html\";:g' pts-core/commands/gui_gtk.php > $DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/commands/gui_gtk.php
|
||||
|
||||
# XDG MIME OpenBenchmarking support
|
||||
if [ "X$DESTDIR" = "X" ]
|
||||
if [ "X$DESTDIR" = "X" ] && which xdg-mime >/dev/null && which xdg-icon-resource >/dev/null
|
||||
then
|
||||
#No chroot
|
||||
xdg-mime install pts-core/openbenchmarking.org/openbenchmarking-mime.xml
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#
|
||||
# Phoronix Test Suite
|
||||
# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
# Copyright (C) 2008 - 2014, Phoronix Media
|
||||
# Copyright (C) 2008 - 2014, Michael Larabel
|
||||
# Copyright (C) 2008 - 2015, Phoronix Media
|
||||
# Copyright (C) 2008 - 2015, Michael Larabel
|
||||
# phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -31,6 +31,15 @@ then
|
||||
cd $PTS_DIR
|
||||
fi
|
||||
|
||||
# Run any start-up hooks, such as to pre-seed environment variables or other non-default behaviors / customizations
|
||||
if [ -d pts-core/hooks/startup ]
|
||||
then
|
||||
for file in pts-core/hooks/startup/*.sh
|
||||
do
|
||||
./$file
|
||||
done
|
||||
fi
|
||||
|
||||
# Determine PHP binary location
|
||||
if [ ! "X$PHP_BIN" = "X" ] && [ -x $PHP_BIN ]
|
||||
then
|
||||
@@ -53,15 +62,18 @@ then
|
||||
elif [ -x /usr/pkg/libexec/cgi-bin/php ]
|
||||
then
|
||||
export PHP_BIN="/usr/pkg/libexec/cgi-bin/php"
|
||||
elif which php >/dev/null ;
|
||||
elif which php >/dev/null 2>&1 ;
|
||||
then
|
||||
export PHP_BIN="php"
|
||||
elif which php5 >/dev/null ;
|
||||
elif which php5 >/dev/null 2>&1 ;
|
||||
then
|
||||
export PHP_BIN="php5"
|
||||
elif [ -x /usr/bin/hhvm ]
|
||||
then
|
||||
export PHP_BIN="/usr/bin/hhvm"
|
||||
elif which hhvm >/dev/null 2>&1 ;
|
||||
then
|
||||
export PHP_BIN="hhvm"
|
||||
else
|
||||
export PHP_BIN=""
|
||||
fi
|
||||
@@ -129,6 +141,9 @@ case "$1" in
|
||||
"test-module" | "debug-module" | "webui")
|
||||
export PTS_IGNORE_MODULES=1
|
||||
;;
|
||||
"enterprise-setup")
|
||||
export PTS_SILENT_MODE=1
|
||||
;;
|
||||
esac
|
||||
|
||||
export PTS_EXT_LAUNCH_SCRIPT_DIR=`mktemp -d 2>/dev/null || mktemp -d -t ptstmp`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:: Phoronix Test Suite
|
||||
:: URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
:: Copyright (C) 2008 - 2014, Phoronix Media
|
||||
:: Copyright (C) 2008 - 2014, Michael Larabel
|
||||
:: Copyright (C) 2008 - 2015, Phoronix Media
|
||||
:: Copyright (C) 2008 - 2015, Michael Larabel
|
||||
:: phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
|
||||
::
|
||||
:: This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2013, Phoronix Media
|
||||
Copyright (C) 2008 - 2013, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -87,7 +87,7 @@ class build_suite implements pts_option_interface
|
||||
}
|
||||
while($input_option != 'Save & Exit');
|
||||
|
||||
$suite_identifier = pts_test_run_manager::clean_save_name($suite_name);
|
||||
$suite_identifier = $suite_writer->clean_save_name_string($suite_name);
|
||||
$save_to = PTS_TEST_SUITE_PATH . 'local/' . $suite_identifier . '/suite-definition.xml';
|
||||
mkdir(dirname($save_to));
|
||||
|
||||
|
||||
@@ -42,22 +42,22 @@ class debug_websocket_client implements pts_option_interface
|
||||
pts_web_socket_client::$debug_mode = true;
|
||||
$ws_client = new pts_web_socket_client($web_socket_address, $web_socket_port);
|
||||
|
||||
$ws_client->send_message('TEST 123');
|
||||
$ws_client->send_message('BIG TEST SENDDDDDDDDDDDDDDDDDDDDDDDDDDDDD MESSSSSSSSSSSSSSSSSSSSSSSSSAGE');
|
||||
$ws_client->send_message('1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE END END END 321');
|
||||
$ws_client->send_message('TEST MESSAGE');
|
||||
$ws_client->send('TEST 123');
|
||||
$ws_client->send('BIG TEST SENDDDDDDDDDDDDDDDDDDDDDDDDDDDDD MESSSSSSSSSSSSSSSSSSSSSSSSSAGE');
|
||||
$ws_client->send('1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE 1234678910 VERY LONG MESSAGE END END END 321');
|
||||
$ws_client->send('TEST MESSAGE');
|
||||
|
||||
while(1)
|
||||
{
|
||||
$msg = $ws_client->receive_message();
|
||||
$msg = $ws_client->receive();
|
||||
if($msg != null)
|
||||
{
|
||||
echo PHP_EOL . 'RECEIVED: ' . $ws_client->receive_message() . PHP_EOL;
|
||||
echo PHP_EOL . 'RECEIVED: ' . $ws_client->receive() . PHP_EOL;
|
||||
}
|
||||
|
||||
//if(date('s') % 5 == 0)
|
||||
//{
|
||||
// $ws_client->send_message(rand(1, getrandmax()));
|
||||
// $ws_client->send(rand(1, getrandmax()));
|
||||
//}
|
||||
}
|
||||
$ws_client->disconnect();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2011 - 2012, Phoronix Media
|
||||
Copyright (C) 2011 - 2012, Michael Larabel
|
||||
Copyright (C) 2011 - 2015, Phoronix Media
|
||||
Copyright (C) 2011 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -47,7 +47,7 @@ class detailed_system_info implements pts_option_interface
|
||||
echo 'Virtualization: ' . (phodevi_cpu::virtualization_technology() ? phodevi_cpu::virtualization_technology() : 'NO') . PHP_EOL;
|
||||
|
||||
// Other info
|
||||
foreach(pts_test_run_manager::pull_test_notes(true) as $test_note_head => $test_note)
|
||||
foreach(pts_arrays::to_array(pts_test_run_manager::pull_test_notes(true)) as $test_note_head => $test_note)
|
||||
{
|
||||
echo ucwords(str_replace('-', ' ', $test_note_head)) . ': ' . $test_note . PHP_EOL;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2014, Phoronix Media
|
||||
Copyright (C) 2010 - 2014, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -24,16 +24,6 @@ class dump_documentation implements pts_option_interface
|
||||
{
|
||||
public static function run($r)
|
||||
{
|
||||
if(is_file('/usr/share/php/fpdf/fpdf.php'))
|
||||
{
|
||||
include_once('/usr/share/php/fpdf/fpdf.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo PHP_EOL . 'The FPDF library must be installed.' . PHP_EOL . PHP_EOL;
|
||||
return;
|
||||
}
|
||||
|
||||
$pdf = new pts_pdf_template(pts_title(false), 'Test Client Documentation');
|
||||
$html_doc = new pts_html_template(pts_title(false), 'Test Client Documentation');
|
||||
|
||||
@@ -263,11 +253,11 @@ class dump_documentation implements pts_option_interface
|
||||
|
||||
|
||||
// simple README
|
||||
$readme = 'Phoronix Test Suite ' . PTS_VERSION . PHP_EOL . 'http://www.phoronix-test-suite.com/' . PHP_EOL . '#####################################' . PHP_EOL . PHP_EOL;
|
||||
$readme = '# Phoronix Test Suite ' . PTS_VERSION . PHP_EOL . 'http://www.phoronix-test-suite.com/' . PHP_EOL . PHP_EOL;
|
||||
$readme .= pts_documentation::basic_description() . PHP_EOL . PHP_EOL;
|
||||
$readme .= pts_file_io::file_get_contents(PTS_PATH . 'documentation/stubs/readme-basics.txt') . PHP_EOL . PHP_EOL;
|
||||
$readme = wordwrap($readme, 80, PHP_EOL);
|
||||
file_put_contents(PTS_PATH . 'README', $readme);
|
||||
file_put_contents(PTS_PATH . 'README.md', $readme);
|
||||
|
||||
// Phoromatic Documentation
|
||||
$pdf = new pts_pdf_template(pts_title(false), 'Phoromatic Documentation');
|
||||
|
||||
49
pts-core/commands/enterprise_setup.php
Normal file
49
pts-core/commands/enterprise_setup.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014 - 2015, Phoronix Media
|
||||
Copyright (C) 2014 - 2015, Michael Larabel
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class enterprise_setup implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Other';
|
||||
const doc_description = 'This option can be run by enterprise users immediately after package installation or as part of an in-house setup script. Running this command will ensure the phoronix-test-suite program is never interrupted on new runs to accept user agreement changes and defaults the anonymous usage reporting to being disabled and other conservative defaults.';
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
$force_options = array(
|
||||
'PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting' => 'FALSE'
|
||||
);
|
||||
|
||||
if(pts_network::internet_support_available() == false)
|
||||
{
|
||||
$force_options['PhoronixTestSuite/Options/Networking/NoInternetCommunication'] = 'TRUE';
|
||||
}
|
||||
|
||||
pts_config::user_config_generate($force_options);
|
||||
|
||||
$pso = pts_storage_object::recover_from_file(PTS_CORE_STORAGE);
|
||||
$pso->add_object('user_agreement_cs', 'enterprise-agree');
|
||||
$pso->save_to_file(PTS_CORE_STORAGE);
|
||||
|
||||
echo PHP_EOL . 'Enterprise setup tasks executed.' . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2011, Phoronix Media
|
||||
Copyright (C) 2009 - 2011, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -31,6 +31,10 @@ class finish_run implements pts_option_interface
|
||||
new pts_argument_check(0, array('pts_result_file', 'is_test_result_file'), null)
|
||||
);
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
{
|
||||
pts_tests::invalid_command_helper($passed_args);
|
||||
}
|
||||
public static function run($args)
|
||||
{
|
||||
$save_name = $args[0];
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2012 - 2014, Phoronix Media
|
||||
Copyright (C) 2012 - 2014, Michael Larabel
|
||||
Copyright (C) 2012 - 2015, Phoronix Media
|
||||
Copyright (C) 2012 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -111,7 +111,8 @@ class gui implements pts_option_interface
|
||||
$server_launcher .= ':run_local_server' . PHP_EOL;
|
||||
if(strpos(getenv('PHP_BIN'), 'hhvm'))
|
||||
{
|
||||
$server_launcher .= 'cd ' . PTS_CORE_PATH . 'web-interface\\ && ' . getenv('PHP_BIN') . ' --config ' . PTS_CORE_PATH . 'static\\hhvm-server.hdf -m server -vServer.Port=' . $web_port . ' -vServer.IP=' . $server_ip . ' -vServer.SourceRoot=' . PTS_CORE_PATH . 'web-interface\\' . ' &' . PHP_EOL;
|
||||
echo PHP_EOL . 'Unfortunately, the HHVM built-in web server has abandoned upstream. Users will need to use the PHP binary or other alternatives.' . PHP_EOL . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -138,13 +139,15 @@ class gui implements pts_option_interface
|
||||
|
||||
// WebSocket Server Setup
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_PORT=' . $web_socket_port . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_SERVER=GUI' . PHP_EOL;
|
||||
$server_launcher .= 'cd ' . getenv('PTS_DIR') . ' && PTS_MODE="CLIENT" ' . getenv('PHP_BIN') . ' pts-core/phoronix-test-suite.php start-ws-server &' . PHP_EOL;
|
||||
$server_launcher .= 'websocket_server_pid=$!'. PHP_EOL;
|
||||
|
||||
// HTTP Server Setup
|
||||
if(strpos(getenv('PHP_BIN'), 'hhvm'))
|
||||
{
|
||||
$server_launcher .= 'cd ' . PTS_CORE_PATH . 'web-interface/ && ' . getenv('PHP_BIN') . ' --config ' . PTS_CORE_PATH . 'static/hhvm-server.hdf -m server -vServer.Port=' . $web_port . ' -vServer.IP=' . $server_ip . ' -vServer.SourceRoot=' . PTS_CORE_PATH . 'web-interface/' . ' &' . PHP_EOL;
|
||||
echo PHP_EOL . 'Unfortunately, the HHVM built-in web server has abandoned upstream. Users will need to use the PHP binary or other alternatives.' . PHP_EOL . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ class install_test implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Test Installation';
|
||||
const doc_use_alias = 'install';
|
||||
const doc_description = 'This option will install the selected test(s) inside the testing environment directory). The install process from downloading of the test files to the installation is fully automated. The install option needs to be supplied with the test name or suite as an argument. Optionally, a OpenBenchmarking.org ID or the name of a saved results file can be supplied as well and the test(s) to install will automatically be extracted from that information. If the test is already installed and was run by the latest version of the installation process, no action will be taken. Multiple arguments can be supplied to install additional tests at the same time.';
|
||||
const doc_description = 'This option will install the selected test(s) inside the testing environment directory. The install process from downloading of the test files to the installation is fully automated. The install option needs to be supplied with the test name or suite as an argument. Optionally, a OpenBenchmarking.org ID or the name of a saved results file can be supplied as well and the test(s) to install will automatically be extracted from that information. If the test is already installed and was run by the latest version of the installation process, no action will be taken. Multiple arguments can be supplied to install additional tests at the same time.';
|
||||
|
||||
public static function command_aliases()
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2013, Phoronix Media
|
||||
Copyright (C) 2008 - 2013, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -27,29 +27,12 @@ class make_download_cache implements pts_option_interface
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
if(!empty($r))
|
||||
{
|
||||
$test_profiles = pts_types::identifiers_to_test_profile_objects($r, true, true);
|
||||
// Force refresh of OB repository to ensure the latest profiles
|
||||
pts_openbenchmarking::refresh_repository_lists(null, true);
|
||||
|
||||
if(count($test_profiles) > 0)
|
||||
{
|
||||
echo PHP_EOL . 'Downloading Test Files For: ' . implode(' ', $test_profiles);
|
||||
pts_test_installer::only_download_test_files($test_profiles);
|
||||
}
|
||||
}
|
||||
|
||||
// Generates a PTS Download Cache
|
||||
if(is_writable('/var/cache/phoronix-test-suite/download-cache/'))
|
||||
{
|
||||
// If running as root, might as well write it to the global PTS download cache so other users on system could benefit too
|
||||
$dc_write_directory = '/var/cache/phoronix-test-suite/download-cache/';
|
||||
pts_file_io::mkdir($dc_write_directory);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The user's local cache
|
||||
$dc_write_directory = pts_strings::add_trailing_slash(pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
|
||||
}
|
||||
// Determine cache location
|
||||
$dc_write_directory = pts_strings::add_trailing_slash(pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
|
||||
echo PHP_EOL . 'Download Cache Directory: ' . $dc_write_directory . PHP_EOL;
|
||||
|
||||
if($dc_write_directory == null || !is_writable($dc_write_directory))
|
||||
{
|
||||
@@ -57,7 +40,16 @@ class make_download_cache implements pts_option_interface
|
||||
return false;
|
||||
}
|
||||
|
||||
echo PHP_EOL . 'Download Cache Directory: ' . $dc_write_directory . PHP_EOL;
|
||||
if(!empty($r))
|
||||
{
|
||||
$test_profiles = pts_types::identifiers_to_test_profile_objects($r, true, true);
|
||||
|
||||
if(count($test_profiles) > 0)
|
||||
{
|
||||
echo PHP_EOL . 'Downloading Test Files For: ' . implode(' ', $test_profiles);
|
||||
pts_test_installer::only_download_test_files($test_profiles, $dc_write_directory);
|
||||
}
|
||||
}
|
||||
|
||||
$json_download_cache = array('phoronix-test-suite' => array(
|
||||
'main' => array('generated' => time()),
|
||||
@@ -125,7 +117,18 @@ class make_download_cache implements pts_option_interface
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents($dc_write_directory . 'pts-download-cache.json', json_encode($json_download_cache, JSON_PRETTY_PRINT));
|
||||
$cached_tests = array();
|
||||
foreach(pts_openbenchmarking::available_tests(true, true) as $test)
|
||||
{
|
||||
if(pts_test_install_request::test_files_in_cache($test, true, true) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
array_push($cached_tests, $test);
|
||||
}
|
||||
$json_download_cache['phoronix-test-suite']['cached-tests'] = $cached_tests;
|
||||
|
||||
file_put_contents($dc_write_directory . 'pts-download-cache.json', json_encode($json_download_cache, (defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0)));
|
||||
echo PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014, Phoronix Media
|
||||
Copyright (C) 2014, Michael Larabel
|
||||
Copyright (C) 2014 - 2015, Phoronix Media
|
||||
Copyright (C) 2014 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -62,7 +62,11 @@ class make_openbenchmarking_cache implements pts_option_interface
|
||||
{
|
||||
$file_size = round(filesize(PTS_OPENBENCHMARKING_SCRATCH_PATH . $qualified_identifier . '.zip') / 1024, 2);
|
||||
$info = $file_size . 'KB - ' . sha1_file(PTS_OPENBENCHMARKING_SCRATCH_PATH . $qualified_identifier . '.zip');
|
||||
echo ' ' . str_repeat('.', $terminal_width - strlen($qualified_identifier) - 3 - strlen($info)) . ' ' . $info . PHP_EOL;
|
||||
$r_size = $terminal_width - strlen($qualified_identifier) - 3 - strlen($info);
|
||||
if($r_size > 0)
|
||||
{
|
||||
echo ' ' . str_repeat('.', $terminal_width - strlen($qualified_identifier) - 3 - strlen($info)) . ' ' . $info . PHP_EOL;
|
||||
}
|
||||
$total_cache_count++;
|
||||
$total_cache_size += $file_size;
|
||||
}
|
||||
@@ -88,7 +92,8 @@ class make_openbenchmarking_cache implements pts_option_interface
|
||||
{
|
||||
$file_size = round(filesize(PTS_OPENBENCHMARKING_SCRATCH_PATH . $qualified_identifier . '.zip') / 1024, 2);
|
||||
$info = $file_size . 'KB - ' . sha1_file(PTS_OPENBENCHMARKING_SCRATCH_PATH . $qualified_identifier . '.zip');
|
||||
echo ' ' . str_repeat('.', $terminal_width - strlen($qualified_identifier) - 3 - strlen($info)) . ' ' . $info . PHP_EOL;
|
||||
$dot_size = $terminal_width - strlen($qualified_identifier) - 3 - strlen($info);
|
||||
echo ' ' . str_repeat('.', ($dot_size >= 0 ? $dot_size : 0)) . ' ' . $info . PHP_EOL;
|
||||
$total_cache_count++;
|
||||
$total_cache_size += $file_size;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2010, Phoronix Media
|
||||
Copyright (C) 2008 - 2010, Michael Larabel
|
||||
bilde_png_renderer: The PNG rendering implementation for bilde_renderer.
|
||||
Copyright (C) 2015, Phoronix Media
|
||||
Copyright (C) 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -21,19 +20,25 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class bilde_svgz_renderer extends bilde_svg_renderer
|
||||
class result_file_to_json implements pts_option_interface
|
||||
{
|
||||
public $renderer = "SVGZ";
|
||||
const doc_section = 'Result Management';
|
||||
const doc_description = 'This option will read a saved test results file and output the basic result information to JSON (JavaScript Object Notation).';
|
||||
|
||||
public static function renderer_supported()
|
||||
public static function argument_checks()
|
||||
{
|
||||
return function_exists("gzcompress");
|
||||
return array(
|
||||
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
|
||||
);
|
||||
}
|
||||
public function render_image($output_file = null, $quality = 100)
|
||||
public static function run($r)
|
||||
{
|
||||
$svg_image = parent::render_image(null);
|
||||
|
||||
return $output_file != null ? ($gz = gzopen($output_file, 'w9')) && gzwrite($gz, $svg_image) && gzclose($gz) : gzcompress($svg_image, 9);
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
echo pts_result_file_output::result_file_to_json($result_file);
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
{
|
||||
pts_tests::recently_saved_results();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2014, Phoronix Media
|
||||
Copyright (C) 2009 - 2014, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -33,19 +33,10 @@ class result_file_to_pdf implements pts_option_interface
|
||||
}
|
||||
public static function run($r)
|
||||
{
|
||||
if(is_file('/usr/share/php/fpdf/fpdf.php'))
|
||||
{
|
||||
include_once('/usr/share/php/fpdf/fpdf.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo PHP_EOL . 'The FPDF library must be installed.' . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
|
||||
$_REQUEST['force_format'] = 'PNG'; // Force to PNG renderer
|
||||
$_REQUEST['svg_dom_gd_no_interlacing'] = true; // Otherwise FPDF will fail
|
||||
pts_client::generate_result_file_graphs($r[0], PTS_SAVE_RESULTS_PATH . $r[0] . '/');
|
||||
$tdir = pts_client::create_temporary_directory();
|
||||
pts_client::generate_result_file_graphs($r[0], $tdir);
|
||||
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
$pdf = new pts_pdf_template($result_file->get_title(), null);
|
||||
@@ -81,11 +72,11 @@ class result_file_to_pdf implements pts_option_interface
|
||||
}
|
||||
|
||||
/*
|
||||
if(count($identifiers) > 1 && is_file(PTS_SAVE_RESULTS_PATH . $r[0] . '/result-graphs/overview.jpg'))
|
||||
if(count($identifiers) > 1 && is_file($tdir . 'result-graphs/overview.jpg'))
|
||||
{
|
||||
$pdf->AddPage();
|
||||
$pdf->Ln(100);
|
||||
$pdf->Image(PTS_SAVE_RESULTS_PATH . $r[0] . '/result-graphs/overview.jpg', 15, 40, 180);
|
||||
$pdf->Image($tdir . 'result-graphs/overview.jpg', 15, 40, 180);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -94,10 +85,10 @@ class result_file_to_pdf implements pts_option_interface
|
||||
$placement = 1;
|
||||
for($i = 1; $i <= count($tests); $i++)
|
||||
{
|
||||
if(is_file(PTS_SAVE_RESULTS_PATH . $r[0] . '/result-graphs/' . $i . '.png'))
|
||||
if(is_file($tdir . 'result-graphs/' . $i . '.png'))
|
||||
{
|
||||
$pdf->Ln(100);
|
||||
$pdf->Image(PTS_SAVE_RESULTS_PATH . $r[0] . '/result-graphs/' . $i . '.png', 50, 40 + (($placement - 1) * 120), 120);
|
||||
$pdf->Image($tdir . 'result-graphs/' . $i . '.png', 50, 40 + (($placement - 1) * 120), 120);
|
||||
}
|
||||
|
||||
if($placement == 2)
|
||||
@@ -123,8 +114,8 @@ class result_file_to_pdf implements pts_option_interface
|
||||
}
|
||||
*/
|
||||
$pdf_file = pts_client::user_home_directory() . $r[0] . '.pdf';
|
||||
|
||||
$pdf->Output($pdf_file);
|
||||
pts_file_io::delete($tdir, null, true);
|
||||
echo PHP_EOL . 'Saved To: ' . $pdf_file . PHP_EOL;
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2014, Phoronix Media
|
||||
Copyright (C) 2009 - 2014, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -34,93 +34,7 @@ class result_file_to_text implements pts_option_interface
|
||||
public static function run($r)
|
||||
{
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
$result_output = null;
|
||||
|
||||
$result_output .= $result_file->get_title() . PHP_EOL;
|
||||
$result_output .= $result_file->get_description() . PHP_EOL . PHP_EOL . PHP_EOL;
|
||||
|
||||
$system_identifiers = $result_file->get_system_identifiers();
|
||||
$system_hardware = $result_file->get_system_hardware();
|
||||
$system_software = $result_file->get_system_software();
|
||||
|
||||
for($i = 0; $i < count($system_identifiers); $i++)
|
||||
{
|
||||
$result_output .= $system_identifiers[$i] . ': ' . PHP_EOL . PHP_EOL;
|
||||
$result_output .= "\t" . $system_hardware[$i] . PHP_EOL . PHP_EOL . "\t" . $system_software[$i] . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
$longest_identifier_length = $result_file->get_system_identifiers();
|
||||
$longest_identifier_length = strlen(pts_strings::find_longest_string($longest_identifier_length)) + 2;
|
||||
|
||||
foreach($result_file->get_result_objects() as $result_object)
|
||||
{
|
||||
$result_output .= trim($result_object->test_profile->get_title() . ' ' . $result_object->test_profile->get_app_version() . PHP_EOL . $result_object->get_arguments_description());
|
||||
|
||||
if($result_object->test_profile->get_result_scale() != null)
|
||||
{
|
||||
$result_output .= PHP_EOL . ' ' . $result_object->test_profile->get_result_scale();
|
||||
}
|
||||
|
||||
foreach($result_object->test_result_buffer as &$buffers)
|
||||
{
|
||||
$max_value = 0;
|
||||
$min_value = pts_arrays::first_element($buffers)->get_result_value();
|
||||
foreach($buffers as &$buffer_item)
|
||||
{
|
||||
if($buffer_item->get_result_value() > $max_value)
|
||||
{
|
||||
$max_value = $buffer_item->get_result_value();
|
||||
}
|
||||
else if($buffer_item->get_result_value() < $min_value)
|
||||
{
|
||||
$min_value = $buffer_item->get_result_value();
|
||||
}
|
||||
}
|
||||
|
||||
$longest_result = strlen($max_value) + 1;
|
||||
foreach($buffers as &$buffer_item)
|
||||
{
|
||||
$val = $buffer_item->get_result_value();
|
||||
|
||||
if(stripos($val, ',') !== false)
|
||||
{
|
||||
$vals = explode(',', $val);
|
||||
$val = 'MIN: ' . min($vals) . ' / AVG: ' . round(array_sum($vals) / count($vals), 2) . ' MAX: ' . max($vals);
|
||||
}
|
||||
|
||||
$result_output .= PHP_EOL . ' ' . $buffer_item->get_result_identifier() . ' ';
|
||||
|
||||
$result_length_offset = $longest_identifier_length - strlen($buffer_item->get_result_identifier());
|
||||
if($result_length_offset > 0)
|
||||
{
|
||||
$result_output .= str_repeat('.', $result_length_offset) . ' ';
|
||||
}
|
||||
$result_output .= $val;
|
||||
|
||||
|
||||
if(is_numeric($val))
|
||||
{
|
||||
$result_output .= str_repeat(' ', $longest_result - strlen($val)) . '|';
|
||||
$current_line_length = strlen(substr($result_output, strrpos($result_output, PHP_EOL) + 1)) + 1;
|
||||
$result_output .= str_repeat('=', round(($val / $max_value) * (pts_client::terminal_width() - $current_line_length)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result_output .= PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
/*
|
||||
$file = 'SAVE_TO';
|
||||
|
||||
if(substr($file, -4) != '.txt')
|
||||
{
|
||||
$file .= '.txt';
|
||||
}
|
||||
file_put_contents($file, $result_output);
|
||||
*/
|
||||
|
||||
$result_output = pts_result_file_output::result_file_to_text($result_file, pts_client::terminal_width());
|
||||
echo $result_output;
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014, Phoronix Media
|
||||
Copyright (C) 2014, Michael Larabel
|
||||
Copyright (C) 2014 - 2015, Phoronix Media
|
||||
Copyright (C) 2014 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
class start_phoromatic_server implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'GUI / Web Support';
|
||||
const doc_section = 'Phoromatic';
|
||||
const doc_description = 'Start the Phoromatic web server for controlling local Phoronix Test Suite client systems to facilitate automated and repeated test orchestration and other automated features targeted at the enterprise.';
|
||||
|
||||
public static function run($r)
|
||||
@@ -67,7 +67,7 @@ class start_phoromatic_server implements pts_option_interface
|
||||
}
|
||||
|
||||
$remote_access = is_numeric($remote_access) && $remote_access > 1 ? $remote_access : false;
|
||||
$blocked_ports = array(2049, 3659, 4045, 6000);
|
||||
$blocked_ports = array(2049, 3659, 4045, 6000, 9000);
|
||||
|
||||
if($remote_access)
|
||||
{
|
||||
@@ -123,6 +123,7 @@ class start_phoromatic_server implements pts_option_interface
|
||||
// WebSocket Server Setup
|
||||
$server_launcher .= 'export PTS_WEB_PORT=' . $web_port . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_PORT=' . $web_socket_port . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_SERVER=PHOROMATIC' . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_NO_FLUSH_LOGGER=1' . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_PHOROMATIC_SERVER=1' . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_PHOROMATIC_LOG_LOCATION=' . $pts_logger->get_log_file_location() . PHP_EOL;
|
||||
@@ -133,13 +134,69 @@ class start_phoromatic_server implements pts_option_interface
|
||||
$server_launcher .= 'event_server_pid=$!'. PHP_EOL;
|
||||
|
||||
// HTTP Server Setup
|
||||
if(strpos(getenv('PHP_BIN'), 'hhvm'))
|
||||
if(false && pts_client::executable_in_path('nginx') && is_file('/run/php-fpm/php-fpm.pid'))
|
||||
{
|
||||
// NGINX
|
||||
$nginx_conf = 'error_log /tmp/error.log;
|
||||
pid /tmp/nginx.pid;
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
client_body_temp_path /tmp/client_body;
|
||||
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||
proxy_temp_path /tmp/proxy_temp;
|
||||
scgi_temp_path /tmp/scgi_temp;
|
||||
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 180;
|
||||
types_hash_max_size 2048;
|
||||
include /etc/nginx/mime.types;
|
||||
index index.php;
|
||||
|
||||
server {
|
||||
listen ' . $web_port . ';
|
||||
listen [::]:' . $web_port . ' default ipv6only=on;
|
||||
access_log /tmp/access.log;
|
||||
error_log /tmp/error.log;
|
||||
root ' . PTS_CORE_PATH . 'phoromatic/public_html;
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php;
|
||||
location / {
|
||||
autoindex on;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
}
|
||||
}
|
||||
}';
|
||||
$nginx_conf_file = tempnam(PTS_USER_PATH, 'nginx_conf_');
|
||||
file_put_contents($nginx_conf_file, $nginx_conf);
|
||||
|
||||
$server_launcher .= 'nginx -c ' . $nginx_conf_file . PHP_EOL . 'rm -f ' . $nginx_conf_file . PHP_EOL;
|
||||
}
|
||||
else if(($mongoose = pts_client::executable_in_path('mongoose')) && ($php_cgi = pts_client::executable_in_path('php-cgi')))
|
||||
{
|
||||
// Mongoose Embedded Web Server
|
||||
$server_launcher .= $mongoose . ' -p ' . $web_port . ' -r ' . PTS_CORE_PATH . 'phoromatic/public_html/ -I ' . $php_cgi . ' -i index.php > /dev/null 2>> $PTS_PHOROMATIC_LOG_LOCATION &' . PHP_EOL; //2> /dev/null
|
||||
|
||||
}
|
||||
else if(strpos(getenv('PHP_BIN'), 'hhvm'))
|
||||
{
|
||||
echo PHP_EOL . 'Unfortunately, the HHVM built-in web server has abandoned upstream. Users will need to use the PHP binary or other alternatives.' . PHP_EOL . PHP_EOL;
|
||||
$server_launcher .= 'cd ' . PTS_CORE_PATH . 'phoromatic/public_html/ && ' . getenv('PHP_BIN') . ' --config ' . PTS_CORE_PATH . 'static/hhvm-server.hdf -m server -vServer.Port=' . $web_port . ' -vServer.IP=' . $server_ip . ' -vServer.SourceRoot=' . PTS_CORE_PATH . 'phoromatic/ > /dev/null 2>> $PTS_PHOROMATIC_LOG_LOCATION &' . PHP_EOL;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// PHP Web Server
|
||||
$server_launcher .= getenv('PHP_BIN') . ' -S ' . $server_ip . ':' . $web_port . ' -t ' . PTS_CORE_PATH . 'phoromatic/public_html/ > /dev/null 2>> $PTS_PHOROMATIC_LOG_LOCATION &' . PHP_EOL; //2> /dev/null
|
||||
}
|
||||
$server_launcher .= 'http_server_pid=$!'. PHP_EOL;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2012 - 2014, Phoronix Media
|
||||
Copyright (C) 2012 - 2014, Michael Larabel
|
||||
Copyright (C) 2012 - 2015, Phoronix Media
|
||||
Copyright (C) 2012 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -73,13 +73,15 @@ class start_remote_gui_server implements pts_option_interface
|
||||
|
||||
// WebSocket Server Setup
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_PORT=' . $web_socket_port . PHP_EOL;
|
||||
$server_launcher .= 'export PTS_WEBSOCKET_SERVER=GUI' . PHP_EOL;
|
||||
$server_launcher .= 'cd ' . getenv('PTS_DIR') . ' && PTS_MODE="CLIENT" ' . getenv('PHP_BIN') . ' pts-core/phoronix-test-suite.php start-ws-server &' . PHP_EOL;
|
||||
$server_launcher .= 'websocket_server_pid=$!'. PHP_EOL;
|
||||
|
||||
// HTTP Server Setup
|
||||
if(strpos(getenv('PHP_BIN'), 'hhvm'))
|
||||
{
|
||||
$server_launcher .= 'cd ' . PTS_CORE_PATH . 'web-interface/ && ' . getenv('PHP_BIN') . ' --config ' . PTS_CORE_PATH . 'static/hhvm-server.hdf -m server -vServer.Port=' . $web_port . ' -vServer.IP=' . $server_ip . ' -vServer.SourceRoot=' . PTS_CORE_PATH . 'web-interface/' . ' &' . PHP_EOL;
|
||||
echo PHP_EOL . 'Unfortunately, the HHVM built-in web server has abandoned upstream. Users will need to use the PHP binary or other alternatives.' . PHP_EOL . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2013 - 2014, Phoronix Media
|
||||
Copyright (C) 2013 - 2014, Michael Larabel
|
||||
Copyright (C) 2013 - 2015, Phoronix Media
|
||||
Copyright (C) 2013 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -23,7 +23,7 @@
|
||||
class start_ws_server implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Web / GUI Support';
|
||||
const doc_description = 'Manually start a WebSocket server for communication by remote Phoronix Test Suite GUIs, the Phoronix Test Suite Multi-System Commander, and other functionality.';
|
||||
const doc_description = 'Manually start a WebSocket server for communication by remote Phoronix Test Suite GUIs, the Phoronix Test Suite Multi-System Commander, and other functionality. This function checks the PTS_WEBSOCKET_PORT and PTS_WEBSOCKET_SERVER environment variables for configuration.';
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
@@ -66,7 +66,17 @@ class start_ws_server implements pts_option_interface
|
||||
}
|
||||
} */
|
||||
|
||||
$websocket = new pts_web_socket_server('localhost', $web_socket_port);
|
||||
switch(getenv('PTS_WEBSOCKET_SERVER'))
|
||||
{
|
||||
case 'PHOROMATIC':
|
||||
pts_web_socket::$mask_send = true;
|
||||
$websocket = new pts_web_socket_server_phoromatic('localhost', $web_socket_port);
|
||||
break;
|
||||
default:
|
||||
case 'GUI':
|
||||
$websocket = new pts_web_socket_server_gui('localhost', $web_socket_port);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
102
pts-core/commands/stress_run.php
Normal file
102
pts-core/commands/stress_run.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2015, Phoronix Media
|
||||
Copyright (C) 2015, Michael Larabel
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class stress_run implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Testing';
|
||||
const doc_description = 'This option will run the passed tests/suites in the multi-process stress-testing mode. The stress-run mode will not produce a result file but is rather intended for running multiple test profiles concurrently to stress / burn-in the system. The number of tests to run concurrently can be toggled via the PTS_CONCURRENT_TEST_RUNS environment variable and by default is set to a value of 2.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check('VARIABLE_LENGTH', array('pts_types', 'identifier_to_object'), null)
|
||||
);
|
||||
}
|
||||
public static function run($to_run)
|
||||
{
|
||||
pts_test_run_manager::set_batch_mode(array(
|
||||
'UploadResults' => false,
|
||||
'SaveResults' => false,
|
||||
'PromptForTestDescription' => false,
|
||||
'RunAllTestCombinations' => false,
|
||||
'PromptSaveName' => false,
|
||||
'PromptForTestIdentifier' => false,
|
||||
'OpenBrowser' => false
|
||||
));
|
||||
|
||||
$tests_to_run_concurrently = 2;
|
||||
|
||||
if(($j = getenv('PTS_CONCURRENT_TEST_RUNS')) && is_numeric($j) && $j > 1)
|
||||
{
|
||||
$tests_to_run_concurrently = $j;
|
||||
echo 'PTS_CONCURRENT_TEST_RUNS set; running ' . $tests_to_run_concurrently . ' tests concurrently.' . PHP_EOL;
|
||||
}
|
||||
|
||||
$test_flags = pts_c::batch_mode;
|
||||
|
||||
if(pts_test_run_manager::initial_checks($to_run, $test_flags, 'SHORT') == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
if(count($to_run) < $tests_to_run_concurrently)
|
||||
{
|
||||
echo PHP_EOL . 'More tests must be specified in order to run ' . $tests_to_run_concurrently . ' tests concurrently.';
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
$test_run_manager = new pts_test_run_manager($test_flags);
|
||||
|
||||
// Load the tests to run
|
||||
if($test_run_manager->load_tests_to_run($to_run) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Run the actual tests
|
||||
$total_loop_time = pts_client::read_env('TOTAL_LOOP_TIME');
|
||||
if($total_loop_time == 'infinite')
|
||||
{
|
||||
$total_loop_time = 'infinite';
|
||||
echo 'TOTAL_LOOP_TIME set; running tests in an infinite loop until otherwise triggered' . PHP_EOL;
|
||||
}
|
||||
else if($total_loop_time && is_numeric($total_loop_time) && $total_loop_time > 9)
|
||||
{
|
||||
$total_loop_time = $total_loop_time * 60;
|
||||
echo 'TOTAL_LOOP_TIME set; running tests for ' . ($total_loop_time / 60) . ' minutes' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_loop_time = false;
|
||||
}
|
||||
//$test_run_manager->pre_execution_process();
|
||||
$test_run_manager->multi_test_stress_run_execute($tests_to_run_concurrently, $total_loop_time);
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
{
|
||||
pts_tests::invalid_command_helper($passed_args);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2011, Phoronix Media
|
||||
Copyright (C) 2010 - 2011, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -77,7 +77,7 @@ class upload_test_suite implements pts_option_interface
|
||||
}
|
||||
if(isset($json['openbenchmarking']['upload']['url']) && !empty($json['openbenchmarking']['upload']['url']))
|
||||
{
|
||||
pts_openbenchmarking_client::refresh_repository_lists(null, true);
|
||||
pts_openbenchmarking::refresh_repository_lists(null, true);
|
||||
echo 'URL: ' . $json['openbenchmarking']['upload']['url'] . PHP_EOL;
|
||||
}
|
||||
echo PHP_EOL;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2011, Phoronix Media
|
||||
Copyright (C) 2009 - 2011, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -31,7 +31,7 @@ class validate_result_file implements pts_option_interface
|
||||
{
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
pts_client::$display->generic_heading($r[0]);
|
||||
$valid = $result_file->xml_parser->validate();
|
||||
$valid = $result_file->validate();
|
||||
|
||||
if($valid == false)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Fedora / Red Hat package installation
|
||||
|
||||
if [ `whoami` = "ec2-user" ]; then
|
||||
if [ -x /usr/bin/dnf ]; then
|
||||
sudo dnf -y install $*
|
||||
elif [ `whoami` = "ec2-user" ]; then
|
||||
sudo yum -y --skip-broken install $*
|
||||
else
|
||||
echo "Please enter your root password below:" 1>&2
|
||||
|
||||
@@ -218,5 +218,9 @@
|
||||
<GenericName>opencl</GenericName>
|
||||
<PackageName>opencl-headers</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>attr</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>superlu</GenericName>
|
||||
<PackageName>superlu libsuperlu3</PackageName>
|
||||
<PackageName>superlu-devel</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>suitesparse</GenericName>
|
||||
@@ -250,5 +250,9 @@
|
||||
<GenericName>opencl</GenericName>
|
||||
<PackageName>opencl-headers</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>attr</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
<GenericName>blas-development</GenericName>
|
||||
<Title>Basic Linear Algebra Sub-Routine Library</Title>
|
||||
<PossibleNames>libblas-dev, libblas-devel, blas-devel, blas</PossibleNames>
|
||||
<FileCheck>cblas.h</FileCheck>
|
||||
<FileCheck>libblas.so</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>lapack-development</GenericName>
|
||||
@@ -377,8 +377,8 @@
|
||||
<Package>
|
||||
<GenericName>superlu</GenericName>
|
||||
<Title>SuperLU</Title>
|
||||
<PossibleNames>superlu, libsuperlu3-dev</PossibleNames>
|
||||
<FileCheck>superlu/slu_util.h</FileCheck>
|
||||
<PossibleNames>superlu, libsuperlu3-dev, SuperLU-devel</PossibleNames>
|
||||
<FileCheck>superlu/slu_util.h OR SuperLU/slu_util.h, libsuperlu.so</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>suitesparse</GenericName>
|
||||
@@ -398,5 +398,11 @@
|
||||
<PossibleNames>tinyxml-dev</PossibleNames>
|
||||
<FileCheck>tinyxml.h</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<Title>Attr</Title>
|
||||
<PossibleNames>attr, libattr1-dev</PossibleNames>
|
||||
<FileCheck>attr/xattr.h</FileCheck>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -240,5 +240,9 @@
|
||||
<GenericName>opencl</GenericName>
|
||||
<PackageName>dev-util/opencl-headers</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>sys-apps/attr</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -246,5 +246,9 @@
|
||||
<GenericName>tinyxml</GenericName>
|
||||
<PackageName>tinyxml-devel</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>attr</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -295,5 +295,9 @@
|
||||
<GenericName>opencl</GenericName>
|
||||
<PackageName>opencl-headers ocl-icd-libopencl1</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>libattr1-dev</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -104,6 +104,10 @@
|
||||
<PackageName>libjpeg</PackageName>
|
||||
<FileCheck>/usr/include/jpeglib.h</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>attr</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>libaio-development</GenericName>
|
||||
<PackageName>libaio</PackageName>
|
||||
|
||||
8
pts-core/hooks/startup/template.sh
Executable file
8
pts-core/hooks/startup/template.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Scripts placed within this directory are called immediately prior to launching the Phoronix Test Suite for the first time.
|
||||
|
||||
# hooks/startup are useful if wanting to pre-seed certain environment variables prior to executing the Phoronix Test Suite, etc.
|
||||
|
||||
# No special environment variables are passed/pre-seeded prior to running the scripts in this folder.
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2014, Phoronix Media
|
||||
Copyright (C) 2009 - 2014, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -23,7 +23,7 @@
|
||||
class phoromatic extends pts_module_interface
|
||||
{
|
||||
const module_name = 'Phoromatic Client';
|
||||
const module_version = '0.2.0';
|
||||
const module_version = '1.0.0';
|
||||
const module_description = 'The Phoromatic client is used for connecting to a Phoromatic server (Phoromatic.com or a locally run server) to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner. For more details visit http://www.phoromatic.com/. This module is intended to be used with Phoronix Test Suite 5.2+ clients and servers.';
|
||||
const module_author = 'Phoronix Media';
|
||||
|
||||
@@ -46,7 +46,7 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
public static function user_commands()
|
||||
{
|
||||
return array('connect' => 'run_connection', 'explore' => 'explore_network', 'upload_result' => 'upload_unscheduled_result', 'set_root_admin_password' => 'set_root_admin_password');
|
||||
return array('connect' => 'run_connection', 'explore' => 'explore_network', 'upload_result' => 'upload_unscheduled_result', 'set_root_admin_password' => 'set_root_admin_password', 'list_results' => 'recent_phoromatic_server_results', 'clone' => 'clone_phoromatic_server_result', 'export_results_for_account_schedules' => 'generate_export_result_schedule_dump');
|
||||
}
|
||||
public static function upload_unscheduled_result($args)
|
||||
{
|
||||
@@ -99,6 +99,14 @@ class phoromatic extends pts_module_interface
|
||||
$new_root_pw = hash('sha256', 'PTS' . $new_root_pw);
|
||||
$root_admin_pw = phoromatic_server::save_setting('root_admin_pw', $new_root_pw);
|
||||
}
|
||||
public static function generate_export_result_schedule_dump($r)
|
||||
{
|
||||
phoromatic_server::prepare_database();
|
||||
if(isset($r[0]) && !empty($r[0]))
|
||||
{
|
||||
phoromatic_server::generate_result_export_dump($r[0]);
|
||||
}
|
||||
}
|
||||
public static function explore_network()
|
||||
{
|
||||
pts_client::$display->generic_heading('Phoromatic Servers');
|
||||
@@ -109,6 +117,7 @@ class phoromatic extends pts_module_interface
|
||||
foreach($archived_servers as $archived_server)
|
||||
{
|
||||
$response = pts_network::http_get_contents('http://' . $archived_server['ip'] . ':' . $archived_server['http_port'] . '/server.php?phoromatic_info');
|
||||
|
||||
if(!empty($response))
|
||||
{
|
||||
$response = json_decode($response, true);
|
||||
@@ -121,24 +130,39 @@ class phoromatic extends pts_module_interface
|
||||
echo 'SERVER: ' . $response['http_server'] . PHP_EOL;
|
||||
echo 'PHORONIX TEST SUITE: ' . $response['pts'] . ' [' . $response['pts_core'] . ']' . PHP_EOL;
|
||||
|
||||
$repo = pts_network::http_get_contents('http://' . $archived_server['ip'] . ':' . $archived_server['http_port'] . '/download-cache.php?repo');
|
||||
echo 'DOWNLOAD CACHE: ';
|
||||
if(!empty($repo))
|
||||
// TODO XXX fix/finish below code...
|
||||
if(false && ($ws = new phoromatic_client_comm_ws($archived_server['ip'], $response['ws_port'])))
|
||||
{
|
||||
$repo = json_decode($repo, true);
|
||||
if($repo && isset($repo['phoronix-test-suite']['download-cache']))
|
||||
{
|
||||
$total_file_size = 0;
|
||||
foreach($repo['phoronix-test-suite']['download-cache'] as $file_name => $inf)
|
||||
{
|
||||
$total_file_size += $repo['phoronix-test-suite']['download-cache'][$file_name]['file_size'];
|
||||
}
|
||||
echo count($repo['phoronix-test-suite']['download-cache']) . ' FILES / ' . round($total_file_size / 1000000) . ' MB CACHE SIZE';
|
||||
}
|
||||
// Query the WebSocket Server for some Phoromatic Server details
|
||||
$s = $ws->send(array('phoromatic' => array('event' => 'pts-version')));
|
||||
$s = $ws->send(array('phoromatic' => array('event' => 'download-cache')));
|
||||
$r = $ws->receive_until('download-cache');
|
||||
var_dump($r);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'N/A';
|
||||
|
||||
// Provide some other server info via HTTP
|
||||
|
||||
$repo = pts_network::http_get_contents('http://' . $archived_server['ip'] . ':' . $archived_server['http_port'] . '/download-cache.php?repo');
|
||||
echo 'DOWNLOAD CACHE: ';
|
||||
if(!empty($repo))
|
||||
{
|
||||
$repo = json_decode($repo, true);
|
||||
if($repo && isset($repo['phoronix-test-suite']['download-cache']))
|
||||
{
|
||||
$total_file_size = 0;
|
||||
foreach($repo['phoronix-test-suite']['download-cache'] as $file_name => $inf)
|
||||
{
|
||||
$total_file_size += $repo['phoronix-test-suite']['download-cache'][$file_name]['file_size'];
|
||||
}
|
||||
echo count($repo['phoronix-test-suite']['download-cache']) . ' FILES / ' . round($total_file_size / 1000000) . ' MB CACHE SIZE';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'N/A';
|
||||
}
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
@@ -169,12 +193,60 @@ class phoromatic extends pts_module_interface
|
||||
echo PHP_EOL . 'No Phoromatic Servers detected.' . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
}
|
||||
protected static function tick_thread()
|
||||
{
|
||||
static $last_phoromatic_log = 0;
|
||||
|
||||
while(true)
|
||||
{
|
||||
$j = array();
|
||||
|
||||
$log_size = pts_client::$pts_logger->get_log_file_size();
|
||||
if($log_size != $last_phoromatic_log)
|
||||
{
|
||||
$phoromatic_log = file_get_contents(pts_client::$pts_logger->get_log_file_location());
|
||||
$last_phoromatic_log = $log_size;
|
||||
$j['phoromatic']['client-log'] = $phoromatic_log;
|
||||
}
|
||||
|
||||
foreach(phodevi::supported_sensors() as $sensor)
|
||||
{
|
||||
$j['phoromatic']['stats']['sensors'][phodevi::sensor_name($sensor)] = array('value' => phodevi::read_sensor($sensor), 'unit' => phodevi::read_sensor_unit($sensor));
|
||||
}
|
||||
|
||||
$j['phoromatic']['stats']['uptime'] = ceil(phodevi::system_uptime() / 60);
|
||||
|
||||
$server_response = phoromatic::upload_to_remote_server(array(
|
||||
'r' => 'tick',
|
||||
'j' => json_encode($j),
|
||||
));
|
||||
|
||||
$server_response = json_decode($server_response, true);
|
||||
if($server_response && isset($server_response['phoromatic']['tick_thread']))
|
||||
{
|
||||
switch($server_response['phoromatic']['tick_thread'])
|
||||
{
|
||||
case 'reboot':
|
||||
if(pts_client::executable_in_path('reboot'))
|
||||
{
|
||||
shell_exec('reboot');
|
||||
}
|
||||
break;
|
||||
case 'halt-testing':
|
||||
touch(PTS_USER_PATH . 'halt-testing');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sleep(60);
|
||||
}
|
||||
}
|
||||
protected static function upload_to_remote_server($to_post, $server_address = null, $server_http_port = null, $account_id = null)
|
||||
{
|
||||
static $last_communication_minute = null;
|
||||
static $communication_attempts = 0;
|
||||
|
||||
if($last_communication_minute == date('i') && $communication_attempts > 3)
|
||||
if($last_communication_minute == date('i') && $communication_attempts > 8)
|
||||
{
|
||||
// Something is wrong, Phoromatic shouldn't be communicating with server more than four times a minute
|
||||
return false;
|
||||
@@ -225,7 +297,7 @@ class phoromatic extends pts_module_interface
|
||||
pts_client::$pts_logger && pts_client::$pts_logger->log($current_task);
|
||||
$last_msg = $current_task;
|
||||
|
||||
return $server_response = phoromatic::upload_to_remote_server(array(
|
||||
return phoromatic::upload_to_remote_server(array(
|
||||
'r' => 'update_system_status',
|
||||
'a' => $current_task,
|
||||
'time' => $estimated_time_remaining,
|
||||
@@ -240,7 +312,7 @@ class phoromatic extends pts_module_interface
|
||||
'r' => 'ping',
|
||||
), $server_ip, $http_port);
|
||||
}
|
||||
protected static function setup_server_addressing($server_string)
|
||||
protected static function setup_server_addressing($server_string = null)
|
||||
{
|
||||
if(isset($server_string[0]) && strpos($server_string[0], '/', strpos($server_string[0], ':')) > 6)
|
||||
{
|
||||
@@ -249,6 +321,7 @@ class phoromatic extends pts_module_interface
|
||||
self::$server_address = substr($server_string[0], 0, strpos($server_string[0], ':'));
|
||||
self::$server_http_port = substr($server_string[0], strlen(self::$server_address) + 1, -1 - strlen(self::$account_id));
|
||||
pts_client::$display->generic_heading('Server IP: ' . self::$server_address . PHP_EOL . 'Server HTTP Port: ' . self::$server_http_port . PHP_EOL . 'Account ID: ' . self::$account_id);
|
||||
pts_client::register_phoromatic_server(self::$server_address, self::$server_http_port);
|
||||
}
|
||||
else if(($last_server = trim(pts_module::read_file('last-phoromatic-server'))) && !empty($last_server))
|
||||
{
|
||||
@@ -258,7 +331,7 @@ class phoromatic extends pts_module_interface
|
||||
$last_server_http_port = substr($last_server, strlen($last_server_address) + 1, -1 - strlen($last_account_id));
|
||||
pts_client::$pts_logger && pts_client::$pts_logger->log('Last Server IP: ' . $last_server_address . ' Last Server HTTP Port: ' . $last_server_http_port . ' Last Account ID: ' . $last_account_id);
|
||||
|
||||
for($i = 0; $i < 3; $i++)
|
||||
for($i = 0; $i < 12; $i++)
|
||||
{
|
||||
$server_response = phoromatic::upload_to_remote_server(array(
|
||||
'r' => 'ping',
|
||||
@@ -271,12 +344,13 @@ class phoromatic extends pts_module_interface
|
||||
self::$server_http_port = $last_server_http_port;
|
||||
self::$account_id = $last_account_id;
|
||||
pts_client::$pts_logger && pts_client::$pts_logger->log('Phoromatic Server connection restored');
|
||||
pts_client::register_phoromatic_server(self::$server_address, self::$server_http_port);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
pts_client::$pts_logger && pts_client::$pts_logger->log('Phoromatic Server connection failed');
|
||||
sleep((10 * ($i + 1)));
|
||||
sleep((12 * ($i + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,6 +412,14 @@ class phoromatic extends pts_module_interface
|
||||
|
||||
return false;
|
||||
}
|
||||
protected static function setup_system_environment()
|
||||
{
|
||||
if(is_writable('/boot/grub/grubenv') && pts_client::executable_in_path('grub-editenv'))
|
||||
{
|
||||
// In case system fails or reboots in process and don't want to hang on GRUB recordfail
|
||||
shell_exec('grub-editenv /boot/grub/grubenv unset recordfail 2>&1');
|
||||
}
|
||||
}
|
||||
public static function run_connection($args)
|
||||
{
|
||||
if(pts_client::create_lock(PTS_USER_PATH . 'phoromatic_lock') == false)
|
||||
@@ -351,15 +433,17 @@ class phoromatic extends pts_module_interface
|
||||
{
|
||||
pts_client::$pts_logger = new pts_logger();
|
||||
}
|
||||
pts_client::$pts_logger->log(pts_title(true) . ' starting Phoromatic client');
|
||||
pts_client::$pts_logger->log(pts_title(true) . ' [' . PTS_CORE_VERSION . '] starting Phoromatic client');
|
||||
|
||||
if(phodevi::system_uptime() < 300)
|
||||
if(phodevi::system_uptime() < 60)
|
||||
{
|
||||
echo 'PHOROMATIC: Sleeping for 60 seconds as system freshly started.' . PHP_EOL;
|
||||
pts_client::$pts_logger->log('Sleeping for 60 seconds as system freshly started');
|
||||
sleep(60);
|
||||
}
|
||||
|
||||
$server_setup = self::setup_server_addressing($args);
|
||||
//$http_comm = new phoromatic_client_comm_http();
|
||||
|
||||
if(!$server_setup)
|
||||
return false;
|
||||
@@ -367,6 +451,11 @@ class phoromatic extends pts_module_interface
|
||||
$times_failed = 0;
|
||||
$has_success = false;
|
||||
$do_exit = false;
|
||||
$just_started = true;
|
||||
|
||||
self::setup_system_environment();
|
||||
pts_client::$pts_logger->log('SYSTEM HARDWARE: ' . phodevi::system_hardware(true));
|
||||
pts_client::$pts_logger->log('SYSTEM SOFTWARE: ' . phodevi::system_software(true));
|
||||
|
||||
while($do_exit == false)
|
||||
{
|
||||
@@ -380,16 +469,29 @@ class phoromatic extends pts_module_interface
|
||||
|
||||
pts_client::$pts_logger->log('Server response failed');
|
||||
|
||||
if($times_failed > 2)
|
||||
if($times_failed >= 2)
|
||||
{
|
||||
trigger_error('Communication with server failed.', E_USER_ERROR);
|
||||
|
||||
if(PTS_IS_DAEMONIZED_SERVER_PROCESS == false && $times_failed > 4)
|
||||
if(PTS_IS_DAEMONIZED_SERVER_PROCESS == false && $times_failed > 5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if(PTS_IS_DAEMONIZED_SERVER_PROCESS && $times_failed > 10)
|
||||
{
|
||||
if(pts_client::executable_in_path('reboot'))
|
||||
{
|
||||
shell_exec('reboot');
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(substr($server_response, 0, 1) == '[')
|
||||
{
|
||||
// Likely a notice/warning from server
|
||||
echo PHP_EOL . substr($server_response, 0, strpos($server_response, PHP_EOL)) . PHP_EOL;
|
||||
}
|
||||
else if(substr($server_response, 0, 1) == '{')
|
||||
{
|
||||
$times_failed = 0;
|
||||
@@ -413,24 +515,66 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
}
|
||||
|
||||
if($just_started)
|
||||
{
|
||||
if(PTS_IS_DAEMONIZED_SERVER_PROCESS)
|
||||
{
|
||||
$pid = pcntl_fork();
|
||||
if($pid == 0)
|
||||
{
|
||||
// Start the tick thread
|
||||
self::tick_thread();
|
||||
}
|
||||
}
|
||||
|
||||
$just_started = false;
|
||||
}
|
||||
|
||||
if(isset($json['phoromatic']['pre_set_sys_env_vars']) && !empty($json['phoromatic']['pre_set_sys_env_vars']))
|
||||
{
|
||||
// pre_set_sys_env_vars was added during PTS 5.8 development
|
||||
// Sets environment variables on client as specified via the Phoromatic Server's systems page
|
||||
foreach(explode(';', $json['phoromatic']['pre_set_sys_env_vars']) as $i => $v_string)
|
||||
{
|
||||
$var = explode('=', $v_string);
|
||||
if(count($var) == 2)
|
||||
{
|
||||
putenv($var[0] . '=' . $var[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch(isset($json['phoromatic']['task']) ? $json['phoromatic']['task'] : null)
|
||||
{
|
||||
case 'install':
|
||||
phoromatic::update_system_status('Installing Tests');
|
||||
pts_suite_nye_XmlReader::set_temporary_suite('pre-seed', $json['phoromatic']['test_suite']);
|
||||
pts_test_installer::standard_install('pre-seed');
|
||||
break;
|
||||
case 'benchmark':
|
||||
|
||||
// Make sure all latest tests are available
|
||||
pts_openbenchmarking::refresh_repository_lists(null, true);
|
||||
|
||||
$benchmark_timer = time();
|
||||
self::$is_running_as_phoromatic_node = true;
|
||||
$test_flags = pts_c::auto_mode | pts_c::batch_mode;
|
||||
$suite_identifier = sha1(time() . rand(0, 100));
|
||||
$suite_identifier = sha1(time() . rand(2, 1000));
|
||||
pts_suite_nye_XmlReader::set_temporary_suite($suite_identifier, $json['phoromatic']['test_suite']);
|
||||
self::$p_save_identifier = $json['phoromatic']['trigger_id'];
|
||||
$phoromatic_results_identifier = self::$p_save_identifier;
|
||||
$phoromatic_save_identifier = $json['phoromatic']['save_identifier'];
|
||||
self::$p_schedule_id = $json['phoromatic']['schedule_id'];
|
||||
self::$p_schedule_id = isset($json['phoromatic']['schedule_id']) ? $json['phoromatic']['schedule_id'] : false;
|
||||
self::$p_trigger_id = self::$p_save_identifier;
|
||||
phoromatic::update_system_status('Running Benchmarks For Schedule: ' . $phoromatic_save_identifier);
|
||||
$benchmark_ticket_id = isset($json['phoromatic']['benchmark_ticket_id']) ? $json['phoromatic']['benchmark_ticket_id'] : null;
|
||||
phoromatic::update_system_status('Running Benchmarks For: ' . $phoromatic_save_identifier);
|
||||
|
||||
if(pts_strings::string_bool($json['phoromatic']['settings']['RunInstallCommand']))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['pre_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'PRE_INSTALL');
|
||||
if(isset($json['phoromatic']['pre_install_set_context']))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['pre_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'PRE_INSTALL');
|
||||
}
|
||||
|
||||
if(pts_strings::string_bool($json['phoromatic']['settings']['ForceInstallTests']))
|
||||
{
|
||||
@@ -439,12 +583,16 @@ class phoromatic extends pts_module_interface
|
||||
|
||||
pts_client::set_test_flags($test_flags);
|
||||
pts_test_installer::standard_install($suite_identifier);
|
||||
phoromatic::set_user_context($json['phoromatic']['post_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'POST_INSTALL');
|
||||
if(isset($json['phoromatic']['post_install_set_context']))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['post_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'POST_INSTALL');
|
||||
}
|
||||
}
|
||||
$env_vars = isset($json['phoromatic']['environment_variables']) ? pts_strings::parse_value_string_vars($json['phoromatic']['environment_variables']) : array();
|
||||
|
||||
// Do the actual running
|
||||
phodevi::clear_cache();
|
||||
if(pts_test_run_manager::initial_checks($suite_identifier))
|
||||
if(pts_test_run_manager::initial_checks($suite_identifier, 0, 'SHORT'))
|
||||
{
|
||||
self::$test_run_manager = new pts_test_run_manager($test_flags);
|
||||
pts_test_run_manager::set_batch_mode(array(
|
||||
@@ -457,7 +605,12 @@ class phoromatic extends pts_module_interface
|
||||
// Load the tests to run
|
||||
if(self::$test_run_manager->load_tests_to_run($suite_identifier))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['pre_run_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'PRE_RUN');
|
||||
phoromatic::update_system_status('Tests In Run Queue: ' . implode(', ', self::$test_run_manager->get_tests_to_run_identifiers()));
|
||||
if(isset($json['phoromatic']['pre_run_set_context']))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['pre_run_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'PRE_RUN');
|
||||
}
|
||||
|
||||
if(isset($json['phoromatic']['settings']['UploadResultsToOpenBenchmarking']) && pts_strings::string_bool($json['phoromatic']['settings']['UploadResultsToOpenBenchmarking']))
|
||||
{
|
||||
self::$test_run_manager->auto_upload_to_openbenchmarking();
|
||||
@@ -465,11 +618,28 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
|
||||
// Save results?
|
||||
self::$test_run_manager->auto_save_results($phoromatic_save_identifier, $phoromatic_results_identifier, 'A Phoromatic run.');
|
||||
|
||||
// Run the actual tests
|
||||
self::$test_run_manager->pre_execution_process();
|
||||
self::$test_run_manager->call_test_runs();
|
||||
if(isset($env_vars['PTS_CONCURRENT_TEST_RUNS']) && $env_vars['PTS_CONCURRENT_TEST_RUNS'] > 1)
|
||||
{
|
||||
$total_loop_time = isset($env_vars['TOTAL_LOOP_TIME']) ? $env_vars['TOTAL_LOOP_TIME'] : false;
|
||||
pts_client::$pts_logger->log('STRESS / MULTI-TEST EXECUTION STARTED @ ' . date('Y-m-d H:i:s'));
|
||||
pts_client::$pts_logger->log('CONCURRENT RUNS = ' . $env_vars['PTS_CONCURRENT_TEST_RUNS'] . ' TOTAL LOOP TIME = ' . $total_loop_time);
|
||||
$r = self::$test_run_manager->multi_test_stress_run_execute($env_vars['PTS_CONCURRENT_TEST_RUNS'], $total_loop_time);
|
||||
if($r == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pts_client::$pts_logger->log('STRESS / MULTI-TEST EXECUTION ENDED @ ' . date('Y-m-d H:i:s'));
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$test_run_manager->auto_save_results($phoromatic_save_identifier, $phoromatic_results_identifier, (isset($json['phoromatic']['test_description']) ? $json['phoromatic']['test_description'] : 'A Phoromatic run.'));
|
||||
self::$test_run_manager->pre_execution_process();
|
||||
self::$test_run_manager->call_test_runs();
|
||||
}
|
||||
|
||||
phoromatic::update_system_status('Benchmarks Completed For: ' . $phoromatic_save_identifier);
|
||||
self::$test_run_manager->post_execution_process();
|
||||
$elapsed_benchmark_time = time() - $benchmark_timer;
|
||||
@@ -477,14 +647,18 @@ class phoromatic extends pts_module_interface
|
||||
// Handle uploading data to server
|
||||
$result_file = new pts_result_file(self::$test_run_manager->get_file_name());
|
||||
$upload_system_logs = pts_strings::string_bool($json['phoromatic']['settings']['UploadSystemLogs']);
|
||||
$server_response = self::upload_test_result($result_file, $upload_system_logs, $json['phoromatic']['schedule_id'], $phoromatic_save_identifier, $json['phoromatic']['trigger_id'], $elapsed_benchmark_time);
|
||||
pts_client::$pts_logger->log('DEBUG RESPONSE MESSAGE: ' . $server_response);
|
||||
$server_response = self::upload_test_result($result_file, $upload_system_logs, (isset($json['phoromatic']['schedule_id']) ? $json['phoromatic']['schedule_id'] : null), $phoromatic_save_identifier, $json['phoromatic']['trigger_id'], $elapsed_benchmark_time, $benchmark_ticket_id);
|
||||
//pts_client::$pts_logger->log('DEBUG RESPONSE MESSAGE: ' . $server_response);
|
||||
if(!pts_strings::string_bool($json['phoromatic']['settings']['ArchiveResultsLocally']))
|
||||
{
|
||||
pts_client::remove_saved_result_file(self::$test_run_manager->get_file_name());
|
||||
}
|
||||
}
|
||||
phoromatic::set_user_context($json['phoromatic']['post_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'POST_RUN');
|
||||
|
||||
if(isset($json['phoromatic']['post_install_set_context']))
|
||||
{
|
||||
phoromatic::set_user_context($json['phoromatic']['post_install_set_context'], self::$p_trigger_id, self::$p_schedule_id, 'POST_RUN');
|
||||
}
|
||||
}
|
||||
self::$p_schedule_id = null;
|
||||
self::$is_running_as_phoromatic_node = false;
|
||||
@@ -511,10 +685,12 @@ class phoromatic extends pts_module_interface
|
||||
if(!$supports_wol)
|
||||
break;
|
||||
case 'shutdown':
|
||||
if(pts_module::read_file('block-poweroff'))
|
||||
if(isset($json['phoromatic']['client_update_script']) && !empty($json['phoromatic']['client_update_script']))
|
||||
{
|
||||
break;
|
||||
self::run_client_update_script($json['phoromatic']['client_update_script']);
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
echo PHP_EOL . 'Phoromatic received a remote command to shutdown.' . PHP_EOL;
|
||||
phoromatic::update_system_status('Attempting System Shutdown');
|
||||
if(pts_client::executable_in_path('poweroff'))
|
||||
@@ -529,6 +705,10 @@ class phoromatic extends pts_module_interface
|
||||
sleep(60);
|
||||
break;
|
||||
case 'idle':
|
||||
if(isset($json['phoromatic']['client_update_script']) && !empty($json['phoromatic']['client_update_script']))
|
||||
{
|
||||
self::run_client_update_script($json['phoromatic']['client_update_script']);
|
||||
}
|
||||
//echo PHP_EOL . 'Idling, waiting for task.' . PHP_EOL;
|
||||
phoromatic::update_system_status('Idling, Waiting For Task');
|
||||
break;
|
||||
@@ -542,13 +722,16 @@ class phoromatic extends pts_module_interface
|
||||
|
||||
if(!$do_exit)
|
||||
{
|
||||
sleep(60);
|
||||
if($server_response == false)
|
||||
sleep(rand(10, 30));
|
||||
else
|
||||
sleep(60);
|
||||
}
|
||||
}
|
||||
|
||||
pts_client::release_lock(PTS_USER_PATH . 'phoromatic_lock');
|
||||
}
|
||||
private static function upload_test_result(&$result_file, $upload_system_logs = true, $schedule_id = 0, $save_identifier = null, $trigger = null, $elapsed_time = 0)
|
||||
private static function upload_test_result(&$result_file, $upload_system_logs = true, $schedule_id = 0, $save_identifier = null, $trigger = null, $elapsed_time = 0, $benchmark_ticket_id = null)
|
||||
{
|
||||
$system_logs = null;
|
||||
$system_logs_hash = null;
|
||||
@@ -604,7 +787,7 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
}
|
||||
|
||||
$composite_xml = $result_file->xml_parser->getXML();
|
||||
$composite_xml = $result_file->getRawXml();
|
||||
$composite_xml_hash = sha1($composite_xml);
|
||||
$composite_xml_type = 'composite_xml';
|
||||
|
||||
@@ -620,18 +803,92 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
|
||||
// Upload to Phoromatic
|
||||
return phoromatic::upload_to_remote_server(array(
|
||||
'r' => 'result_upload',
|
||||
//'ob' => $ob_data['id'],
|
||||
'sched' => $schedule_id,
|
||||
'o' => $save_identifier,
|
||||
'ts' => $trigger,
|
||||
'et' => $elapsed_time,
|
||||
$composite_xml_type => base64_encode($composite_xml),
|
||||
'composite_xml_hash' => $composite_xml_hash,
|
||||
'system_logs_zip' => $system_logs,
|
||||
'system_logs_hash' => $system_logs_hash
|
||||
));
|
||||
$times_tried = 0;
|
||||
do
|
||||
{
|
||||
if($times_tried > 0)
|
||||
{
|
||||
sleep(rand(5, 20));
|
||||
}
|
||||
|
||||
$res = phoromatic::upload_to_remote_server(array(
|
||||
'r' => 'result_upload',
|
||||
//'ob' => $ob_data['id'],
|
||||
'sched' => $schedule_id,
|
||||
'bid' => $benchmark_ticket_id,
|
||||
'o' => $save_identifier,
|
||||
'ts' => $trigger,
|
||||
'et' => $elapsed_time,
|
||||
$composite_xml_type => base64_encode($composite_xml),
|
||||
'composite_xml_hash' => $composite_xml_hash,
|
||||
'system_logs_zip' => $system_logs,
|
||||
'system_logs_hash' => $system_logs_hash
|
||||
));
|
||||
|
||||
$times_tried++;
|
||||
}
|
||||
while($res == false && $times_tried < 4);
|
||||
|
||||
return $res;
|
||||
}
|
||||
public static function recent_phoromatic_server_results()
|
||||
{
|
||||
self::setup_server_addressing();
|
||||
$server_response = phoromatic::upload_to_remote_server(array('r' => 'list_results'));
|
||||
$server_response = json_decode($server_response, true);
|
||||
|
||||
if(isset($server_response['phoromatic']['results']) && !empty($server_response['phoromatic']['results']))
|
||||
{
|
||||
foreach($server_response['phoromatic']['results'] as $pprid => $result)
|
||||
{
|
||||
echo sprintf('%-26ls - %-25ls - %-30ls', $result['Title'], $pprid, date('j M H:i', strtotime($result['UploadTime']))) . PHP_EOL;
|
||||
echo sprintf(' %-20ls - %-25ls' . PHP_EOL, $result['SystemName'], $result['GroupName']) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
else
|
||||
echo PHP_EOL . 'No Phoromatic Server results discovered.';
|
||||
|
||||
echo PHP_EOL;
|
||||
}
|
||||
public static function clone_phoromatic_server_result($args)
|
||||
{
|
||||
self::setup_server_addressing();
|
||||
|
||||
$id = $args[0];
|
||||
$server_response = phoromatic::upload_to_remote_server(array('r' => 'clone_result', 'i' => $id));
|
||||
$server_response = json_decode($server_response, true);
|
||||
|
||||
if(isset($server_response['phoromatic']['result']['composite_xml']) && !empty($server_response['phoromatic']['result']['composite_xml']))
|
||||
{
|
||||
$composite_xml = base64_decode($server_response['phoromatic']['result']['composite_xml']);
|
||||
$result_file = new pts_result_file($composite_xml);
|
||||
// TODO XXX: Add system log downloading support
|
||||
|
||||
$result_file_writer = new pts_result_file_writer();
|
||||
$result_file_writer->add_result_file_meta_data($result_file, $id);
|
||||
$result_file_writer->add_system_information_from_result_file($result_file);
|
||||
$result_file_writer->add_results_from_result_file($result_file);
|
||||
pts_client::save_test_result($id . '/composite.xml', $result_file_writer->get_xml(), true);
|
||||
echo PHP_EOL . 'Result File Saved As: ' . $id . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
else
|
||||
echo PHP_EOL . 'No Phoromatic result found.' . PHP_EOL;
|
||||
}
|
||||
private static function run_client_update_script($update_script)
|
||||
{
|
||||
static $last_update_script_check_time = 0;
|
||||
|
||||
// Don't keep checking it so check no more than every 20 minutes
|
||||
if($last_update_script_check_time < (time() - 1200) && !empty($update_script))
|
||||
{
|
||||
$last_update_script_check_time = time();
|
||||
$update_file = pts_client::create_temporary_file();
|
||||
$update_script = str_replace("\r", PHP_EOL, $update_script);
|
||||
file_put_contents($update_file, $update_script);
|
||||
phoromatic::update_system_status('Running Phoronix Test Suite Update Script');
|
||||
$env_vars = array();
|
||||
pts_client::shell_exec('bash ' . $update_file . ' 2>&1', $env_vars);
|
||||
}
|
||||
}
|
||||
private static function set_user_context($context_script, $trigger, $schedule_id, $process)
|
||||
{
|
||||
@@ -724,7 +981,7 @@ class phoromatic extends pts_module_interface
|
||||
return false;
|
||||
}
|
||||
|
||||
phoromatic::update_system_status('Running: ' . $pts_test_result->test_profile->get_identifier(),
|
||||
phoromatic::update_system_status('Running: ' . $pts_test_result->test_profile->get_identifier() . ($pts_test_result->get_arguments_description() != null ? ' [' . $pts_test_result->get_arguments_description() . ']' : null),
|
||||
ceil(self::$test_run_manager->get_estimated_run_time() / 60),
|
||||
self::$test_run_manager->get_percent_complete(),
|
||||
null,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2012, Phoronix Media
|
||||
Copyright (C) 2008 - 2012, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
timed_screenshot.php: A PTS module that takes a screenshot at a pre-defined interval.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,7 @@
|
||||
class timed_screenshot extends pts_module_interface
|
||||
{
|
||||
const module_name = 'Timed Screenshot';
|
||||
const module_version = '1.0.0';
|
||||
const module_version = '1.0.1';
|
||||
const module_description = 'This is a module that will take a screenshot of the system at a pre-defined interval. ImageMagick must be installed onto the system prior to using this module.';
|
||||
const module_author = 'Michael Larabel';
|
||||
|
||||
@@ -81,7 +81,7 @@ class timed_screenshot extends pts_module_interface
|
||||
foreach($screenshots as $screenshot)
|
||||
{
|
||||
// Compress the PNGs a bit
|
||||
pts_image::compres_png_image($screenshot, 9);
|
||||
pts_image::compress_png_image($screenshot, 9);
|
||||
}
|
||||
|
||||
return $screenshots;
|
||||
|
||||
1861
pts-core/objects/FPDF.php
Normal file
1861
pts-core/objects/FPDF.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,274 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2011, Phoronix Media
|
||||
Copyright (C) 2008 - 2011, Michael Larabel
|
||||
bilde_gd_renderer: An abstract class providing a GD library renderer that can then be extended by a PNG and JPEG renderer
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
abstract class bilde_gd_renderer extends bilde_renderer
|
||||
{
|
||||
public function __construct($width, $height, $embed_identifiers = null)
|
||||
{
|
||||
$this->image = $this->init_new_gd_image($width, $height);
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
}
|
||||
public static function renderer_supported()
|
||||
{
|
||||
return extension_loaded('gd') && function_exists('imagettftext') && self::find_default_ttf_font();
|
||||
}
|
||||
public function html_embed_code($file_name, $attributes = null, $is_xsl = false)
|
||||
{
|
||||
$file_name = str_replace('BILDE_EXTENSION', strtolower($this->get_renderer()), $file_name);
|
||||
$attributes = pts_arrays::to_array($attributes);
|
||||
$attributes['src'] = $file_name;
|
||||
|
||||
if($is_xsl)
|
||||
{
|
||||
$html = '<img>';
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= '<xsl:attribute name="' . $option . '">' . $value . '</xsl:attribute>';
|
||||
}
|
||||
$html .= '</img>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '<img ';
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= $option . '="' . $value . '" ';
|
||||
}
|
||||
$html .= '/>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/*
|
||||
public function render_image($output_file = null, $quality = 100)
|
||||
{
|
||||
// To be implemented by the class extending bilde_gd_renderer
|
||||
}
|
||||
*/
|
||||
|
||||
public function resize_image($width, $height)
|
||||
{
|
||||
$img = $this->image;
|
||||
$this->image = $this->init_new_gd_image($width, $height);
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
$this->image_copy_merge($img, 0, 0);
|
||||
}
|
||||
public function destroy_image()
|
||||
{
|
||||
imagedestroy($this->image);
|
||||
}
|
||||
|
||||
public function write_text_left($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
$text_dimensions = $this->text_string_dimensions($text_string, $font_type, $font_size);
|
||||
$text_width = $text_dimensions[0];
|
||||
$text_height = $text_dimensions[1];
|
||||
|
||||
if($rotate_text == false)
|
||||
{
|
||||
$text_x = $bound_x1;
|
||||
$text_y = $bound_y1 + round($text_height / 2);
|
||||
$rotation = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$text_x = $bound_x1 - round($text_height / 4);
|
||||
$text_y = $bound_y1 + round($text_height / 2);
|
||||
$rotation = 270;
|
||||
}
|
||||
imagettftext($this->image, $font_size, $rotation, $text_x, $text_y, $font_color, $font_type, $text_string);
|
||||
}
|
||||
public function write_text_right($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
$text_dimensions = $this->text_string_dimensions($text_string, $font_type, $font_size);
|
||||
$text_width = $text_dimensions[0];
|
||||
$text_height = $text_dimensions[1];
|
||||
$text_x = $bound_x2 - $text_width;
|
||||
$text_y = $bound_y1 + round($text_height / 2);
|
||||
|
||||
if($rotate_text)
|
||||
{
|
||||
$rotation = 90;
|
||||
$text_x += $text_width;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rotation = 0;
|
||||
}
|
||||
|
||||
imagettftext($this->image, $font_size, $rotation, $text_x, $text_y, $font_color, $font_type, $text_string);
|
||||
}
|
||||
public function draw_arc($center_x, $center_y, $radius, $offset_percent, $percent, $body_color, $border_color = null, $border_width = 1, $title = null)
|
||||
{
|
||||
imagefilledarc($this->image, $center_x, $center_y, ($radius * 2), ($radius * 2), ($offset_percent * 360), ($percent * 360), $body_color, IMG_ARC_PIE);
|
||||
}
|
||||
public function write_text_center($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
if($bound_x1 != $bound_x2)
|
||||
{
|
||||
while($this->text_string_width($text_string, $font_type, $font_size) > abs($bound_x2 - $bound_x1 - 2))
|
||||
{
|
||||
$font_size -= 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
$text_dimensions = $this->text_string_dimensions(strtoupper($text_string), $font_type, $font_size);
|
||||
$text_height = $text_dimensions[1];
|
||||
|
||||
$text_dimensions = $this->text_string_dimensions($text_string, $font_type, $font_size);
|
||||
$text_width = $text_dimensions[0];
|
||||
|
||||
if($rotate_text == false)
|
||||
{
|
||||
$rotation = 0;
|
||||
$text_x = (($bound_x2 - $bound_x1) / 2) + $bound_x1 - round($text_width / 2);
|
||||
$text_y = $bound_y1 + $text_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rotation = 90;
|
||||
$text_x = $bound_x1 + $text_height;
|
||||
$text_y = (($bound_y2 - $bound_y1) / 2) + $bound_y1 + round($text_width / 2);
|
||||
}
|
||||
imagettftext($this->image, $font_size, $rotation, $text_x, $text_y, $font_color, $font_type, $text_string);
|
||||
}
|
||||
|
||||
public function draw_rectangle($x1, $y1, $width, $height, $background_color)
|
||||
{
|
||||
imagefilledrectangle($this->image, $x1, $y1, $width, $height, $background_color);
|
||||
}
|
||||
public function draw_rectangle_border($x1, $y1, $width, $height, $border_color)
|
||||
{
|
||||
imagerectangle($this->image, $x1, $y1, $width, $height, $border_color);
|
||||
}
|
||||
public function draw_polygon($points, $body_color, $border_color = null, $border_width = 0)
|
||||
{
|
||||
if(isset($points[0]) && is_array($points[0]) && count($points[0]) >= 2)
|
||||
{
|
||||
$points_r = array();
|
||||
foreach($points as $point_set)
|
||||
{
|
||||
foreach(array_slice($point_set, 0, 2) as $point)
|
||||
{
|
||||
array_push($points_r, $point);
|
||||
}
|
||||
}
|
||||
$points = $points_r;
|
||||
}
|
||||
|
||||
$num_points = floor(count($points) / 2);
|
||||
imagefilledpolygon($this->image, $points, $num_points, $body_color);
|
||||
|
||||
if($border_width > 0 && !empty($border_color))
|
||||
{
|
||||
// TODO: implement $border_width
|
||||
imagepolygon($this->image, $points, $num_points, $border_color);
|
||||
}
|
||||
}
|
||||
public function draw_ellipse($center_x, $center_y, $width, $height, $body_color, $border_color = null, $border_width = 0, $default_hide = false)
|
||||
{
|
||||
if($default_hide == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
imagefilledellipse($this->image, $center_x, $center_y, $width, $height, $body_color);
|
||||
|
||||
if($border_width > 0 && !empty($border_color))
|
||||
{
|
||||
// TODO: implement $border_width
|
||||
imageellipse($this->image, $center_x, $center_y, $width, $height, $border_color);
|
||||
}
|
||||
}
|
||||
public function draw_line($start_x, $start_y, $end_x, $end_y, $color, $line_width = 1, $title = null)
|
||||
{
|
||||
for($i = 0; $i < $line_width; $i++)
|
||||
{
|
||||
if($start_x == $end_x)
|
||||
{
|
||||
imageline($this->image, $start_x + $i, $start_y, $end_x + $i, $end_y, $color);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageline($this->image, $start_x, $start_y + $i, $end_x, $end_y + $i, $color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function png_image_to_type($file)
|
||||
{
|
||||
return imagecreatefrompng($file);
|
||||
}
|
||||
public function jpg_image_to_type($file)
|
||||
{
|
||||
return imagecreatefromjpeg($file);
|
||||
}
|
||||
public function image_copy_merge($source_image_object, $to_x, $to_y, $source_x = 0, $source_y = 0, $width = -1, $height = -1)
|
||||
{
|
||||
if($width == -1)
|
||||
{
|
||||
$width = imagesx($source_image_object);
|
||||
}
|
||||
if($height == -1)
|
||||
{
|
||||
$height = imagesy($source_image_object);
|
||||
}
|
||||
|
||||
imagecopyresampled($this->image, $source_image_object->get_value(), $to_x, $to_y, $source_x, $source_y, $width, $height, $width, $height);
|
||||
}
|
||||
public function convert_hex_to_type($hex)
|
||||
{
|
||||
return imagecolorallocate($this->image, hexdec(substr($hex, 1, 2)), hexdec(substr($hex, 3, 2)), hexdec(substr($hex, 5, 2)));
|
||||
}
|
||||
public function convert_type_to_hex($type)
|
||||
{
|
||||
return '#' . str_pad(base_convert($type, 10, 16), 6, 0, STR_PAD_LEFT);
|
||||
}
|
||||
public function text_string_dimensions($string, $font_type, $font_size, $predefined_string = false)
|
||||
{
|
||||
return $this->soft_text_string_dimensions($string, $font_type, $font_size, $predefined_string);
|
||||
}
|
||||
|
||||
// Privates / Protected
|
||||
|
||||
protected function init_new_gd_image($width, $height)
|
||||
{
|
||||
$img = imagecreatetruecolor($width, $height);
|
||||
|
||||
imageinterlace($img, true);
|
||||
|
||||
if(function_exists('imageantialias'))
|
||||
{
|
||||
imageantialias($img, true);
|
||||
}
|
||||
|
||||
return $img;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2010, Phoronix Media
|
||||
Copyright (C) 2008 - 2010, Michael Larabel
|
||||
bilde_png_renderer: The PNG rendering implementation for bilde_renderer.
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class bilde_png_renderer extends bilde_gd_renderer
|
||||
{
|
||||
public $renderer = "PNG";
|
||||
|
||||
public function render_image($output_file = null, $quality = 100)
|
||||
{
|
||||
$quality = floor(9 - (($quality / 100) * 9)); // calculate compression level
|
||||
if(defined("BILDE_IMAGE_INTERLACING"))
|
||||
{
|
||||
imageinterlace($this->image, BILDE_IMAGE_INTERLACING);
|
||||
}
|
||||
return imagepng($this->image, $output_file, $quality);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,551 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2011, Phoronix Media
|
||||
Copyright (C) 2008 - 2011, Michael Larabel
|
||||
bilde_renderer.php: The Phoronix Multi-Format "Bilde" Image Renderer
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
abstract class bilde_renderer
|
||||
{
|
||||
public $renderer = 'bilde_renderer';
|
||||
protected $image;
|
||||
protected $image_width = -1;
|
||||
protected $image_height = -1;
|
||||
protected $embed_identifiers = null;
|
||||
protected $uid_count = 1;
|
||||
protected $special_attributes = null;
|
||||
|
||||
abstract function __construct($width, $height, $embed_identifiers = null); // create the object
|
||||
|
||||
abstract function html_embed_code($file_name, $attributes = null, $is_xsl = false);
|
||||
abstract function render_image($output_file = null, $quality = 100);
|
||||
abstract function resize_image($width, $height);
|
||||
abstract function destroy_image();
|
||||
|
||||
abstract function write_text_left($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false);
|
||||
abstract function write_text_right($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false);
|
||||
abstract function write_text_center($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false);
|
||||
|
||||
abstract function draw_rectangle($x1, $y1, $width, $height, $background_color);
|
||||
abstract function draw_rectangle_border($x1, $y1, $width, $height, $border_color);
|
||||
abstract function draw_polygon($points, $body_color, $border_color = null, $border_width = 0);
|
||||
abstract function draw_ellipse($center_x, $center_y, $width, $height, $body_color, $border_color = null, $border_width = 0, $default_hide = false);
|
||||
abstract function draw_line($start_x, $start_y, $end_x, $end_y, $color, $line_width = 1, $title = null);
|
||||
abstract function draw_arc($center_x, $center_y, $radius, $offset_percent, $percent, $body_color, $border_color = null, $border_width = 1, $title = null);
|
||||
|
||||
abstract function png_image_to_type($file);
|
||||
abstract function jpg_image_to_type($file);
|
||||
abstract function image_copy_merge($source_image_object, $to_x, $to_y, $source_x = 0, $source_y = 0, $width = -1, $height = -1);
|
||||
abstract function convert_hex_to_type($hex);
|
||||
abstract function convert_type_to_hex($type);
|
||||
abstract function text_string_dimensions($string, $font_type, $font_size, $predefined_string = false);
|
||||
|
||||
//
|
||||
// Meta functions that could be implemented within renderer-specifc code if available
|
||||
//
|
||||
|
||||
public function draw_dashed_line($start_x, $start_y, $end_x, $end_y, $color, $line_width, $dash_length, $blank_length)
|
||||
{
|
||||
if($start_y == $end_y)
|
||||
{
|
||||
$pos = $start_y - ($line_width / 2);
|
||||
|
||||
for($i = $start_x; $i < $end_x; $i += ($blank_length + $dash_length))
|
||||
{
|
||||
$this->draw_line($i, $pos, ($i + $dash_length), $pos, $color, $line_width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pos = $end_x - ($line_width / 2);
|
||||
|
||||
for($i = $start_y; $i < $end_y; $i += ($blank_length + $dash_length))
|
||||
{
|
||||
$this->draw_line($pos, $i, $pos, ($i + $dash_length), $color, $line_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function draw_poly_line($x_y_pair_array, $color, $line_width = 1)
|
||||
{
|
||||
$prev_pair = array_shift($x_y_pair_array);
|
||||
|
||||
foreach($x_y_pair_array as $x_y)
|
||||
{
|
||||
$this->draw_line($prev_pair[0], $prev_pair[1], $x_y[0], $x_y[1], $color, $line_width);
|
||||
$prev_pair = $x_y;
|
||||
}
|
||||
}
|
||||
public function request_uid()
|
||||
{
|
||||
return 'i_' . $this->uid_count++;
|
||||
}
|
||||
public function draw_rectangle_with_border($x1, $y1, $width, $height, $background_color, $border_color, $title = null)
|
||||
{
|
||||
$this->draw_rectangle($x1, $y1, $width, $height, $background_color);
|
||||
$this->draw_rectangle_border($x1, $y1, $width, $height, $border_color);
|
||||
}
|
||||
public function draw_arrow($tip_x1, $tip_y1, $tail_x1, $tail_y1, $background_color, $border_color = null, $border_width = 0)
|
||||
{
|
||||
$is_vertical = ($tip_x1 == $tail_x1);
|
||||
|
||||
if($is_vertical)
|
||||
{
|
||||
// Vertical arrow
|
||||
$arrow_length = sqrt(pow(($tail_x1 - $tip_x1), 2) + pow(($tail_y1 - $tip_y1), 2));
|
||||
$arrow_length_half = $arrow_length / 2;
|
||||
|
||||
$arrow_points = array(
|
||||
$tip_x1, $tip_y1,
|
||||
$tail_x1 + $arrow_length_half, $tail_y1,
|
||||
$tail_x1 - $arrow_length_half, $tail_y1
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Horizontal arrow
|
||||
$arrow_length = sqrt(pow(($tail_x1 - $tip_x1), 2) + pow(($tail_y1 - $tip_y1), 2));
|
||||
$arrow_length_half = $arrow_length / 2;
|
||||
|
||||
$arrow_points = array(
|
||||
$tip_x1, $tip_y1,
|
||||
$tail_x1, $tail_y1 + $arrow_length_half,
|
||||
$tail_x1, $tail_y1 - $arrow_length_half
|
||||
);
|
||||
}
|
||||
|
||||
$this->draw_polygon($arrow_points, $background_color, $border_color, $border_width);
|
||||
}
|
||||
|
||||
public static function renderer_supported()
|
||||
{
|
||||
// This should be implemented by the different bilde renderers if the renderer is dependent upon some extensions or something else for the support
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Setup Functions
|
||||
//
|
||||
|
||||
public static function setup_renderer($requested_renderer, $width, $height, $embed_identifiers = null, $special_attributes = null)
|
||||
{
|
||||
bilde_renderer::setup_font_directory();
|
||||
$available_renderers = array('PNG', 'JPG', 'GIF', 'SWF', 'SVG', 'SVGZ');
|
||||
$selected_renderer = 'SVG';
|
||||
|
||||
if(isset($_SERVER['HTTP_USER_AGENT']))
|
||||
{
|
||||
static $browser_renderer = null;
|
||||
|
||||
if($browser_renderer == null || isset($_REQUEST['force_format']))
|
||||
{
|
||||
$browser_renderer = bilde_renderer_web::browser_compatibility_check($_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
|
||||
$requested_renderer = $browser_renderer;
|
||||
}
|
||||
|
||||
if((($this_renderer = getenv('BILDE_RENDERER')) != false || defined('BILDE_RENDERER') && ($this_renderer = BILDE_RENDERER) || ($this_renderer = $requested_renderer) != null) && in_array($this_renderer, $available_renderers))
|
||||
{
|
||||
$is_supported = call_user_func(array('bilde_' . strtolower($this_renderer) . '_renderer', 'renderer_supported'));
|
||||
|
||||
if($is_supported)
|
||||
{
|
||||
$selected_renderer = $this_renderer;
|
||||
}
|
||||
}
|
||||
|
||||
switch(strtolower($selected_renderer))
|
||||
{
|
||||
case 'svg':
|
||||
$renderer = new bilde_svg_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
case 'png':
|
||||
$renderer = new bilde_png_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
case 'jpg':
|
||||
$renderer = new bilde_jpg_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
case 'gif':
|
||||
$renderer = new bilde_gif_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
case 'swf':
|
||||
$renderer = new bilde_swf_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
case 'svgz':
|
||||
$renderer = new bilde_svgz_renderer($width, $height, $embed_identifiers);
|
||||
break;
|
||||
}
|
||||
|
||||
if($special_attributes != null)
|
||||
{
|
||||
$renderer->set_special_attributes($special_attributes);
|
||||
}
|
||||
|
||||
return $renderer;
|
||||
}
|
||||
public function set_special_attributes($attributes)
|
||||
{
|
||||
$this->special_attributes = $attributes;
|
||||
}
|
||||
public function render_to_file($output_file = null, $quality = 100)
|
||||
{
|
||||
$output_file = str_replace('BILDE_EXTENSION', strtolower($this->get_renderer()), $output_file);
|
||||
return $this->render_image($output_file, $quality);
|
||||
}
|
||||
|
||||
//
|
||||
// Generic Functions
|
||||
//
|
||||
|
||||
public static function setup_font_directory()
|
||||
{
|
||||
// Setup directory for TTF Fonts
|
||||
if(getenv('GDFONTPATH') == false)
|
||||
{
|
||||
if(defined('CUSTOM_FONT_DIR'))
|
||||
{
|
||||
putenv('GDFONTPATH=' . CUSTOM_FONT_DIR);
|
||||
}
|
||||
else if(defined('FONT_DIR'))
|
||||
{
|
||||
putenv('GDFONTPATH=' . FONT_DIR);
|
||||
}
|
||||
else if(($font_env = getenv('FONT_DIR')) != false)
|
||||
{
|
||||
putenv('GDFONTPATH=' . $font_env);
|
||||
}
|
||||
else
|
||||
{
|
||||
putenv('GDFONTPATH=' . getcwd());
|
||||
}
|
||||
}
|
||||
}
|
||||
public static function find_default_ttf_font($find_font = null)
|
||||
{
|
||||
if(!defined('BILDE_DEFAULT_FONT'))
|
||||
{
|
||||
if(is_readable($find_font))
|
||||
{
|
||||
$default_font = $find_font;
|
||||
}
|
||||
else if(ini_get('open_basedir'))
|
||||
{
|
||||
$default_font = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$default_font = false;
|
||||
$possible_fonts = array(
|
||||
'/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf',
|
||||
'/usr/share/fonts/truetype/freefont/FreeSans.ttf',
|
||||
'/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
|
||||
'/usr/share/fonts/dejavu/DejaVuSans.ttf',
|
||||
'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',
|
||||
'/usr/share/fonts/truetype/DejaVuSans.ttf',
|
||||
'/usr/share/fonts/truetype/LiberationSans-Regular.ttf',
|
||||
'/usr/share/fonts/TTF/dejavu/DejaVuSans.ttf',
|
||||
'/usr/share/fonts/TTF/liberation/LiberationSans-Regular.ttf',
|
||||
'/usr/X11/lib/X11/fonts/TrueType/arphic/uming.ttf',
|
||||
'/usr/local/lib/X11/fonts/bitstream-vera/Vera.ttf'
|
||||
);
|
||||
|
||||
foreach($possible_fonts as $font_file)
|
||||
{
|
||||
if(is_readable($font_file))
|
||||
{
|
||||
$default_font = $font_file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define('BILDE_DEFAULT_FONT', $default_font);
|
||||
}
|
||||
|
||||
return BILDE_DEFAULT_FONT;
|
||||
}
|
||||
public function get_renderer()
|
||||
{
|
||||
return $this->renderer;
|
||||
}
|
||||
public function get_image_width()
|
||||
{
|
||||
return $this->image_width;
|
||||
}
|
||||
public function get_image_height()
|
||||
{
|
||||
return $this->image_height;
|
||||
}
|
||||
public function image_file_to_type($file)
|
||||
{
|
||||
$return_type = null;
|
||||
|
||||
if(is_readable($file))
|
||||
{
|
||||
$file_extension = strtoupper(substr($file, strrpos($file, '.') + 1));
|
||||
|
||||
switch($file_extension)
|
||||
{
|
||||
case 'PNG':
|
||||
$return_type = $this->png_image_to_type($file);
|
||||
break;
|
||||
case 'JPG':
|
||||
case 'JPEG':
|
||||
$return_type = $this->jpg_image_to_type($file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $return_type;
|
||||
}
|
||||
public static function soft_text_string_dimensions($text_string, $font_type, $font_size, $predefined_string = false)
|
||||
{
|
||||
bilde_renderer::setup_font_directory();
|
||||
|
||||
if(function_exists('imagettfbbox') && $font_type != false)
|
||||
{
|
||||
$box_array = imagettfbbox($font_size, 0, $font_type, $text_string);
|
||||
$box_width = $box_array[4] - $box_array[6];
|
||||
|
||||
if($predefined_string)
|
||||
{
|
||||
$box_array = imagettfbbox($font_size, 0, $font_type, 'JAZ@![]()@|_qy');
|
||||
}
|
||||
|
||||
$box_height = $box_array[1] - $box_array[7];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Basic calculation
|
||||
$box_height = 0.75 * $font_size;
|
||||
$box_width = 0.8 * strlen($text_string) * $font_size; // 0.8 now but should be about 1.18
|
||||
}
|
||||
|
||||
// Width x Height
|
||||
return array($box_width, $box_height);
|
||||
}
|
||||
public static function color_gradient($color1, $color2, $color_weight)
|
||||
{
|
||||
$color1 = self::color_hex_to_rgb($color1);
|
||||
$color2 = self::color_hex_to_rgb($color2);
|
||||
|
||||
$diff_r = $color2['r'] - $color1['r'];
|
||||
$diff_g = $color2['g'] - $color1['g'];
|
||||
$diff_b = $color2['b'] - $color1['b'];
|
||||
|
||||
$r = ($color1['r'] + $diff_r * $color_weight);
|
||||
$g = ($color1['g'] + $diff_g * $color_weight);
|
||||
$b = ($color1['b'] + $diff_b * $color_weight);
|
||||
|
||||
return self::color_rgb_to_hex($r, $g, $b);
|
||||
}
|
||||
public static function color_shade($color, $percent, $mask)
|
||||
{
|
||||
$color = self::color_hex_to_rgb($color);
|
||||
|
||||
foreach($color as &$color_value)
|
||||
{
|
||||
$color_value = round($color_value * $percent) + round($mask * (1 - $percent));
|
||||
$color_value = $color_value > 255 ? 255 : $color_value;
|
||||
}
|
||||
|
||||
return self::color_rgb_to_hex($color['r'], $color['g'], $color['b']);
|
||||
}
|
||||
public static function color_cache($ns, $id, &$colors)
|
||||
{
|
||||
//return array_shift($colors);
|
||||
static $cache = array();
|
||||
static $color_shift = 0;
|
||||
static $color_shift_size = 120;
|
||||
$i = count($cache);
|
||||
$color_shift_size = ($i == 0 ? 120 : 360 / $i); // can't be assigned directly to static var
|
||||
|
||||
if(!isset($cache[$ns][$id]))
|
||||
{
|
||||
if(!isset($cache[$ns]))
|
||||
{
|
||||
$cache[$ns] = array();
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if(empty($colors))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$hsl = self::color_rgb_to_hsl($colors[0]);
|
||||
$hsl = bilde_renderer::shift_hsl($hsl, $color_shift % 360);
|
||||
$color = bilde_renderer::color_hsl_to_hex($hsl);
|
||||
|
||||
$color_shift += $color_shift_size;
|
||||
if($color_shift == ($color_shift_size * 3))
|
||||
{
|
||||
$color_shift_size *= 0.3;
|
||||
$colors[0] = self::color_shade($colors[0], 0.9, 1);
|
||||
}
|
||||
else if($color_shift > 630)
|
||||
{
|
||||
// We have already exhausted the cache pool once
|
||||
array_shift($colors);
|
||||
$color_shift = 0;
|
||||
}
|
||||
}
|
||||
while(in_array($color, $cache[$ns]));
|
||||
$cache[$ns][$id] = $color;
|
||||
}
|
||||
|
||||
return $cache[$ns][$id];
|
||||
}
|
||||
public static function color_hex_to_rgb($hex)
|
||||
{
|
||||
$color = hexdec($hex);
|
||||
|
||||
return array(
|
||||
'r' => ($color >> 16) & 0xff,
|
||||
'g' => ($color >> 8) & 0xff,
|
||||
'b' => $color & 0xff
|
||||
);
|
||||
}
|
||||
public static function color_hsl_to_hex($hsl)
|
||||
{
|
||||
if($hsl['s'] == 0)
|
||||
{
|
||||
$rgb['r'] = $hsl['l'] * 255;
|
||||
$rgb['g'] = $hsl['l'] * 255;
|
||||
$rgb['b'] = $hsl['l'] * 255;
|
||||
}
|
||||
else
|
||||
{
|
||||
$conv2 = $hsl['l'] < 0.5 ? $hsl['l'] * (1 + $hsl['s']) : ($hsl['l'] + $hsl['s']) - ($hsl['l'] * $hsl['s']);
|
||||
$conv1 = 2 * $hsl['l'] - $conv2;
|
||||
$rgb['r'] = round(255 * self::color_hue_convert($conv1, $conv2, $hsl['h'] + (1 / 3)));
|
||||
$rgb['g'] = round(255 * self::color_hue_convert($conv1, $conv2, $hsl['h']));
|
||||
$rgb['b'] = round(255 * self::color_hue_convert($conv1, $conv2, $hsl['h'] - (1 / 3)));
|
||||
}
|
||||
|
||||
return self::color_rgb_to_hex($rgb['r'], $rgb['g'], $rgb['b']);
|
||||
}
|
||||
protected static function color_hue_convert($v1, $v2, $vh)
|
||||
{
|
||||
if($vh < 0)
|
||||
{
|
||||
$vh += 1;
|
||||
}
|
||||
|
||||
if($vh > 1)
|
||||
{
|
||||
$vh -= 1;
|
||||
}
|
||||
|
||||
if((6 * $vh) < 1)
|
||||
{
|
||||
return $v1 + ($v2 - $v1) * 6 * $vh;
|
||||
}
|
||||
|
||||
if((2 * $vh) < 1)
|
||||
{
|
||||
return $v2;
|
||||
}
|
||||
|
||||
if((3 * $vh) < 2)
|
||||
{
|
||||
return $v1 + ($v2 - $v1) * ((2 / 3 - $vh) * 6);
|
||||
}
|
||||
|
||||
return $v1;
|
||||
}
|
||||
public static function color_rgb_to_hsl($hex)
|
||||
{
|
||||
$rgb = bilde_renderer::color_hex_to_rgb($hex);
|
||||
|
||||
foreach($rgb as &$value)
|
||||
{
|
||||
$value = $value / 255;
|
||||
}
|
||||
|
||||
$min = min($rgb);
|
||||
$max = max($rgb);
|
||||
$delta = $max - $min;
|
||||
|
||||
$hsl['l'] = ($max + $min) / 2;
|
||||
|
||||
if($delta == 0)
|
||||
{
|
||||
$hsl['h'] = 0;
|
||||
$hsl['s'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hsl['s'] = $delta / ($hsl['l'] < 0.5 ? $max + $min : 2 - $max - $min);
|
||||
|
||||
$delta_rgb = array();
|
||||
foreach($rgb as $color => $value)
|
||||
{
|
||||
$delta_rgb[$color] = ((($max - $value) / 6) + ($max / 2)) / $delta;
|
||||
}
|
||||
|
||||
switch($max)
|
||||
{
|
||||
case $rgb['r']:
|
||||
$hsl['h'] = $delta_rgb['b'] - $delta_rgb['g'];
|
||||
break;
|
||||
case $rgb['g']:
|
||||
$hsl['h'] = (1 / 3) + $delta_rgb['r'] - $delta_rgb['b'];
|
||||
break;
|
||||
case $rgb['b']:
|
||||
default:
|
||||
$hsl['h'] = (2 / 3) + $delta_rgb['g'] - $delta_rgb['r'];
|
||||
break;
|
||||
}
|
||||
|
||||
$hsl['h'] += $hsl['h'] < 0 ? 1 : 0;
|
||||
$hsl['h'] -= $hsl['h'] > 1 ? 1 : 0;
|
||||
}
|
||||
|
||||
return $hsl;
|
||||
}
|
||||
public static function shift_hsl($hsl, $rotate_h_degrees = 180)
|
||||
{
|
||||
if($rotate_h_degrees > 0)
|
||||
{
|
||||
$rotate_dec = $rotate_h_degrees / 360;
|
||||
$hsl['h'] = $hsl['h'] <= $rotate_dec ? $hsl['h'] + $rotate_dec : $hsl['h'] - $rotate_dec;
|
||||
}
|
||||
|
||||
return $hsl;
|
||||
}
|
||||
public static function color_rgb_to_hex($r, $g, $b)
|
||||
{
|
||||
$color = ($r << 16) | ($g << 8) | $b;
|
||||
return '#' . sprintf('%06x', $color);
|
||||
}
|
||||
protected function text_string_width($text_string, $font_type, $font_size)
|
||||
{
|
||||
$dimensions = $this->text_string_dimensions($text_string, $font_type, $font_size);
|
||||
return $dimensions[0];
|
||||
}
|
||||
protected function text_string_height($text_string, $font_type, $font_size)
|
||||
{
|
||||
$dimensions = $this->text_string_dimensions($text_string, $font_type, $font_size);
|
||||
return $dimensions[1];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,127 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2011, Phoronix Media
|
||||
Copyright (C) 2011, Michael Larabel
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class bilde_renderer_web
|
||||
{
|
||||
public static function browser_compatibility_check($user_agent)
|
||||
{
|
||||
if(isset($_REQUEST['force_format']))
|
||||
{
|
||||
return $_REQUEST['force_format'];
|
||||
}
|
||||
|
||||
$user_agent .= ' ';
|
||||
$selected_renderer = 'SVG';
|
||||
|
||||
// Yahoo Slurp, msnbot, and googlebot should always be served SVG so no problems there
|
||||
|
||||
if(($p = strpos($user_agent, 'Gecko/')) !== false)
|
||||
{
|
||||
// Mozilla Gecko-based browser (Firefox, etc)
|
||||
$gecko_date = substr($user_agent, ($p + 6));
|
||||
$gecko_date = substr($gecko_date, 0, 6);
|
||||
|
||||
// Around Firefox 3.0 era is best
|
||||
// Firefox 2.0 mostly works except text might not show...
|
||||
if($gecko_date < 200702)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'AppleWebKit/')) !== false)
|
||||
{
|
||||
// Safari, Google Chrome, Google Chromium, etc
|
||||
$webkit_ver = substr($user_agent, ($p + 12));
|
||||
$webkit_ver = substr($webkit_ver, 0, strpos($webkit_ver, ' '));
|
||||
|
||||
// Webkit 532.2 534.6 (WebOS 3.0.2) on WebOS is buggy for SVG
|
||||
// iPhone OS is using 533 right now
|
||||
if($webkit_ver < 533 || strpos($user_agent, 'hpwOS') !== false)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
|
||||
if(($p = strpos($user_agent, 'Android ')) !== false)
|
||||
{
|
||||
$android_ver = substr($user_agent, ($p + 8), 3);
|
||||
|
||||
// Android browser doesn't support SVG.
|
||||
// Google bug report 1376 for Android - http://code.google.com/p/android/issues/detail?id=1376
|
||||
// Looks like it might work though in 3.0 Honeycomb
|
||||
if($android_ver < 3.0)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'Opera/')) !== false)
|
||||
{
|
||||
// Opera
|
||||
$ver = substr($user_agent, ($p + 6));
|
||||
$ver = substr($ver, 0, strpos($ver, ' '));
|
||||
|
||||
// 9.27, 9.64 displays most everything okay
|
||||
if($ver < 9.27)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
|
||||
// text-alignment is still fucked as of 11.50/12.0
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'Epiphany/')) !== false)
|
||||
{
|
||||
// Older versions of Epiphany. Newer versions should report their Gecko or WebKit appropriately
|
||||
$ver = substr($user_agent, ($p + 9));
|
||||
$ver = substr($ver, 0, 4);
|
||||
|
||||
if($ver < 2.22)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'KHTML/')) !== false)
|
||||
{
|
||||
// KDE Konqueror as of 4.7 is still broken for SVG
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'MSIE ')) !== false)
|
||||
{
|
||||
$ver = substr($user_agent, ($p + 5), 1);
|
||||
|
||||
// Microsoft Internet Explorer 9.0 finally seems to do SVG right
|
||||
if($ver < 10 && $ver != 1)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
}
|
||||
else if(strpos($user_agent, 'facebook') !== false)
|
||||
{
|
||||
// Facebook uses this string for its Like/Share crawler, so serve it a PNG so it can use it as an image
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
|
||||
return $selected_renderer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,605 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2011, Phoronix Media
|
||||
Copyright (C) 2008 - 2011, Michael Larabel
|
||||
bilde_svg_renderer: The SVG rendering implementation for bilde_renderer
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
draw_rectangle*:
|
||||
|
||||
$this->svg_dom->add_element('rect', array('x' => 0, 'y' => 0, 'width' => $this->graph_attr_width, 'height' => $this->graph_attr_height, 'fill' => $this->graph_color_background, 'stroke' => $this->graph_color_border, 'stroke-width' => 1));
|
||||
|
||||
write_text_left:
|
||||
|
||||
$this->svg_dom->add_text_element($text, array('x' => 0, 'y' => 0, 'font-size' => $font_size, 'fill' => $color, 'text-anchor' => 'start', 'dominant-baseline' => 'middle'));
|
||||
|
||||
write_text_right:
|
||||
|
||||
$this->svg_dom->add_text_element($text, array('x' => 0, 'y' => 0, 'font-size' => $font_size, 'fill' => $color, 'text-anchor' => 'end', 'dominant-baseline' => 'middle'));
|
||||
|
||||
write_text_center:
|
||||
$this->svg_dom->add_text_element($text, array('x' => 0, 'y' => 0, 'font-size' => $font_size, 'fill' => $color, 'text-anchor' => 'middle', 'dominant-baseline' => 'text-before-edge'));
|
||||
|
||||
draw_line:
|
||||
|
||||
draw_ellipse
|
||||
|
||||
|
||||
image:
|
||||
|
||||
$this->svg_dom->add_element('image', array('xlink:href' => $img, 'x' => 0, 'y' => 0, 'width' => $this->graph_attr_width, 'height' => $this->graph_attr_height));
|
||||
|
||||
$this->svg_dom->draw_svg_arc($center_x, $center_y, $radius, $offset_percent, $percent, array('fill' => $body_color, 'stroke' => $border_color, 'stroke-width' => $border_width));
|
||||
*/
|
||||
|
||||
class bilde_svg_renderer extends bilde_renderer
|
||||
{
|
||||
public $renderer = 'SVG';
|
||||
private $svg = null;
|
||||
|
||||
public function __construct($width, $height, $embed_identifiers = null)
|
||||
{
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
$this->embed_identifiers = $embed_identifiers;
|
||||
|
||||
$dom = new DOMImplementation();
|
||||
$dtd = $dom->createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');
|
||||
$this->image = $dom->createDocument(null, null, $dtd);
|
||||
$this->image->formatOutput = PTS_IS_CLIENT;
|
||||
|
||||
$pts_comment = $this->image->createComment(pts_title(true) . ' [ http://www.phoronix-test-suite.com/ ]');
|
||||
$this->image->appendChild($pts_comment);
|
||||
|
||||
$this->svg = $this->image->createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
$this->svg->setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
||||
$this->svg->setAttribute('version', '1.1');
|
||||
$this->svg->setAttribute('font-family', 'sans-serif');
|
||||
$this->image->appendChild($this->svg);
|
||||
}
|
||||
public static function renderer_supported()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public function html_embed_code($file_name, $attributes = null, $is_xsl = false)
|
||||
{
|
||||
$file_name = str_replace('BILDE_EXTENSION', 'svg', $file_name);
|
||||
$attributes = pts_arrays::to_array($attributes);
|
||||
$attributes['data'] = $file_name;
|
||||
|
||||
if($is_xsl)
|
||||
{
|
||||
$html = '<object type="image/svg+xml">';
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= '<xsl:attribute name="' . $option . '">' . $value . '</xsl:attribute>';
|
||||
}
|
||||
$html .= '</object>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '<object type="image/svg+xml"';
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= $option . '="' . $value . '" ';
|
||||
}
|
||||
$html .= '/>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
public function resize_image($width, $height)
|
||||
{
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
}
|
||||
public function render_image($output_file = null, $quality = 100)
|
||||
{
|
||||
if($this->image == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->svg->setAttribute('viewbox', '0 0 ' . $this->image_width . ' ' . $this->image_height);
|
||||
$this->svg->setAttribute('width', $this->image_width);
|
||||
$this->svg->setAttribute('height', $this->image_height);
|
||||
|
||||
$svg_image = $this->image->saveXML();
|
||||
|
||||
return $output_file != null ? @file_put_contents($output_file, $svg_image) : $svg_image;
|
||||
}
|
||||
public function destroy_image()
|
||||
{
|
||||
$this->image = null;
|
||||
}
|
||||
public function write_text_left($text, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate = false)
|
||||
{
|
||||
$font_size += 1;
|
||||
$text_element = $this->image->createElement('text');
|
||||
$text_element->setAttribute('x', round($bound_x1));
|
||||
$text_element->setAttribute('y', round($bound_y1));
|
||||
$text_element->setAttribute('font-size', $font_size);
|
||||
|
||||
if($rotate != false)
|
||||
{
|
||||
$rotate = ($rotate === true ? 90 : $rotate);
|
||||
$text_element->setAttribute('transform', "rotate($rotate $bound_x1 $bound_y1)");
|
||||
}
|
||||
|
||||
$text_element->setAttribute('text-anchor', 'start');
|
||||
$text_element->setAttribute('dominant-baseline', 'middle');
|
||||
$text_element->setAttribute('fill', $font_color);
|
||||
$string = $this->image->createTextNode($text);
|
||||
$text_element->appendChild($string);
|
||||
|
||||
if($text instanceof pts_graph_ir_value)
|
||||
{
|
||||
if($text->get_attribute('title') != null)
|
||||
{
|
||||
$text_element->setAttribute('xlink:title', $text->get_attribute('title'));
|
||||
}
|
||||
if($text->get_attribute('font-weight') != null)
|
||||
{
|
||||
$text_element->setAttribute('font-weight', $text->get_attribute('font-weight'));
|
||||
}
|
||||
|
||||
if($text->get_attribute('href') != null)
|
||||
{
|
||||
$link = $this->image->createElement('a');
|
||||
$link->setAttribute('xlink:href', $text->get_attribute('href'));
|
||||
$link->setAttribute('xlink:show', ($text->get_attribute('show') ? $text->get_attribute('show') : 'new'));
|
||||
$link->appendChild($text_element);
|
||||
$this->svg->appendChild($link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg->appendChild($text_element);
|
||||
}
|
||||
public function write_text_right($text, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate = false)
|
||||
{
|
||||
$font_size += 1;
|
||||
$text_element = $this->image->createElement('text');
|
||||
$text_element->setAttribute('x', round($bound_x2));
|
||||
$text_element->setAttribute('y', round($bound_y2));
|
||||
$text_element->setAttribute('font-size', $font_size);
|
||||
|
||||
if($rotate != false)
|
||||
{
|
||||
$rotate = ($rotate === true ? 90 : $rotate);
|
||||
$text_element->setAttribute('transform', "rotate($rotate $bound_x1 $bound_y1)");
|
||||
}
|
||||
|
||||
$text_element->setAttribute('text-anchor', 'end');
|
||||
$text_element->setAttribute('dominant-baseline', 'middle');
|
||||
$text_element->setAttribute('fill', $font_color);
|
||||
$string = $this->image->createTextNode($text);
|
||||
$text_element->appendChild($string);
|
||||
|
||||
if($text instanceof pts_graph_ir_value)
|
||||
{
|
||||
if($text->get_attribute('title') != null)
|
||||
{
|
||||
$text_element->setAttribute('xlink:title', $text->get_attribute('title'));
|
||||
}
|
||||
if($text->get_attribute('font-weight') != null)
|
||||
{
|
||||
$text_element->setAttribute('font-weight', $text->get_attribute('font-weight'));
|
||||
}
|
||||
|
||||
if($text->get_attribute('href') != null)
|
||||
{
|
||||
$link = $this->image->createElement('a');
|
||||
$link->setAttribute('xlink:href', $text->get_attribute('href'));
|
||||
$link->setAttribute('xlink:show', 'new');
|
||||
$link->appendChild($text_element);
|
||||
$this->svg->appendChild($link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg->appendChild($text_element);
|
||||
}
|
||||
public function write_text_center($text, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate = false)
|
||||
{
|
||||
$font_size += 1;
|
||||
$bound_x1 = round(($bound_x1 != $bound_x2) ? abs($bound_x2 - $bound_x1) / 2 + $bound_x1 : $bound_x1);
|
||||
$bound_y1 = round(($bound_y1 != $bound_y2) ? abs($bound_y2 - $bound_y1) / 2 + $bound_y1 : $bound_y1);
|
||||
|
||||
$text_element = $this->image->createElement('text');
|
||||
$text_element->setAttribute('x', $bound_x1);
|
||||
$text_element->setAttribute('y', $bound_y1);
|
||||
$text_element->setAttribute('font-size', $font_size);
|
||||
$text_element->setAttribute('text-anchor', 'middle');
|
||||
|
||||
if($rotate != false)
|
||||
{
|
||||
$rotate = ($rotate === true ? 90 : $rotate);
|
||||
$text_element->setAttribute('transform', "rotate($rotate $bound_x1 $bound_y1)");
|
||||
}
|
||||
|
||||
$text_element->setAttribute('dominant-baseline', 'text-before-edge');
|
||||
$text_element->setAttribute('fill', $font_color);
|
||||
$string = $this->image->createTextNode($text);
|
||||
$text_element->appendChild($string);
|
||||
|
||||
if($text instanceof pts_graph_ir_value)
|
||||
{
|
||||
if($text->get_attribute('title') != null)
|
||||
{
|
||||
$text_element->setAttribute('xlink:title', $text->get_attribute('title'));
|
||||
}
|
||||
if($text->get_attribute('font-weight') != null)
|
||||
{
|
||||
$text_element->setAttribute('font-weight', $text->get_attribute('font-weight'));
|
||||
}
|
||||
|
||||
if($text->get_attribute('href') != null)
|
||||
{
|
||||
$link = $this->image->createElement('a');
|
||||
$link->setAttribute('xlink:href', $text->get_attribute('href'));
|
||||
$link->setAttribute('xlink:show', 'new');
|
||||
$link->appendChild($text_element);
|
||||
$this->svg->appendChild($link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg->appendChild($text_element);
|
||||
}
|
||||
public function draw_rectangle_with_border($x1, $y1, $width, $height, $background_color, $border_color, $title = null)
|
||||
{
|
||||
$width = $width - $x1;
|
||||
$height = $height - $y1;
|
||||
$x1 += $width < 0 ? $width : 0;
|
||||
$y1 += $height < 0 ? $height : 0;
|
||||
|
||||
$rect = $this->image->createElement('rect');
|
||||
$rect->setAttribute('x', $x1);
|
||||
$rect->setAttribute('y', $y1);
|
||||
$rect->setAttribute('width', $width);
|
||||
$rect->setAttribute('height', $height);
|
||||
$rect->setAttribute('fill', $background_color);
|
||||
$rect->setAttribute('stroke', $border_color);
|
||||
$rect->setAttribute('stroke-width', 1);
|
||||
|
||||
if($title != null)
|
||||
{
|
||||
$rect->setAttribute('xlink:title', $title);
|
||||
}
|
||||
|
||||
$this->svg->appendChild($rect);
|
||||
}
|
||||
public function draw_rectangle($x1, $y1, $width, $height, $background_color)
|
||||
{
|
||||
$width = $width - $x1;
|
||||
$height = $height - $y1;
|
||||
$x1 += $width < 0 ? $width : 0;
|
||||
$y1 += $height < 0 ? $height : 0;
|
||||
|
||||
$rect = $this->image->createElement('rect');
|
||||
$rect->setAttribute('x', $x1);
|
||||
$rect->setAttribute('y', $y1);
|
||||
$rect->setAttribute('width', $width);
|
||||
$rect->setAttribute('height', $height);
|
||||
$rect->setAttribute('fill', $background_color);
|
||||
|
||||
$this->svg->appendChild($rect);
|
||||
}
|
||||
public function draw_rectangle_gradient($x1, $y1, $width, $height, $color, $next_color)
|
||||
{
|
||||
$width = $width - $x1;
|
||||
$height = $height - $y1;
|
||||
$x1 += $width < 0 ? $width : 0;
|
||||
$y1 += $height < 0 ? $height : 0;
|
||||
|
||||
static $gradient_count = 1;
|
||||
|
||||
$gradient = $this->image->createElement('linearGradient');
|
||||
$gradient->setAttribute('id', 'g_' . $gradient_count);
|
||||
$gradient->setAttribute('x1', '0%');
|
||||
$gradient->setAttribute('y1', '0%');
|
||||
$gradient->setAttribute('x2', '100%');
|
||||
$gradient->setAttribute('y2', '0%');
|
||||
|
||||
$stop = $this->image->createElement('stop');
|
||||
$stop->setAttribute('offset', '0%');
|
||||
$stop->setAttribute('style', 'stop-color: ' . $color .'; stop-opacity: 1;');
|
||||
$gradient->appendChild($stop);
|
||||
|
||||
$stop = $this->image->createElement('stop');
|
||||
$stop->setAttribute('offset', '100%');
|
||||
$stop->setAttribute('style', 'stop-color: ' . $next_color .'; stop-opacity: 1;');
|
||||
$gradient->appendChild($stop);
|
||||
|
||||
$defs = $this->image->createElement('defs');
|
||||
$defs->appendChild($gradient);
|
||||
$this->svg->appendChild($defs);
|
||||
|
||||
$rect = $this->image->createElement('rect');
|
||||
$rect->setAttribute('x', $x1);
|
||||
$rect->setAttribute('y', $y1);
|
||||
$rect->setAttribute('width', $width);
|
||||
$rect->setAttribute('height', $height);
|
||||
//$rect->setAttribute('fill', $background_color);
|
||||
$rect->setAttribute('style', 'fill:url(#g_' . $gradient_count . ')');
|
||||
$gradient_count++;
|
||||
|
||||
$this->svg->appendChild($rect);
|
||||
}
|
||||
public function draw_rectangle_border($x1, $y1, $width, $height, $border_color)
|
||||
{
|
||||
$width = $width - $x1;
|
||||
$height = $height - $y1;
|
||||
$x1 += $width < 0 ? $width : 0;
|
||||
$y1 += $height < 0 ? $height : 0;
|
||||
|
||||
$rect = $this->image->createElement('rect');
|
||||
$rect->setAttribute('x', $x1);
|
||||
$rect->setAttribute('y', $y1);
|
||||
$rect->setAttribute('width', $width);
|
||||
$rect->setAttribute('height', $height);
|
||||
$rect->setAttribute('fill', 'none');
|
||||
$rect->setAttribute('stroke', $border_color);
|
||||
$rect->setAttribute('stroke-width', 1);
|
||||
|
||||
$this->svg->appendChild($rect);
|
||||
}
|
||||
public function draw_arc($center_x, $center_y, $radius, $offset_percent, $percent, $body_color, $border_color = null, $border_width = 1, $title = null, $dash = false)
|
||||
{
|
||||
$deg = ($percent * 360);
|
||||
$offset_deg = ($offset_percent * 360);
|
||||
$arc = $percent > 0.5 ? 1 : 0;
|
||||
|
||||
$p1_x = round(cos(deg2rad($offset_deg)) * $radius) + $center_x;
|
||||
$p1_y = round(sin(deg2rad($offset_deg)) * $radius) + $center_y;
|
||||
$p2_x = round(cos(deg2rad($offset_deg + $deg)) * $radius) + $center_x;
|
||||
$p2_y = round(sin(deg2rad($offset_deg + $deg)) * $radius) + $center_y;
|
||||
|
||||
$path = $this->image->createElement('path');
|
||||
$path->setAttribute('d', "M$center_x,$center_y L$p1_x,$p1_y A$radius,$radius 0 $arc,1 $p2_x,$p2_y Z");
|
||||
$path->setAttribute('fill', $body_color);
|
||||
$path->setAttribute('stroke', $border_color);
|
||||
$path->setAttribute('stroke-width', $border_width);
|
||||
$path->setAttribute('stroke-linejoin', 'round');
|
||||
|
||||
if($dash)
|
||||
{
|
||||
$path->setAttribute('stroke-dasharray', '10,20');
|
||||
}
|
||||
|
||||
if($title != null)
|
||||
{
|
||||
$path->setAttribute('xlink:title', $title);
|
||||
}
|
||||
|
||||
$this->svg->appendChild($path);
|
||||
}
|
||||
public function draw_polygon($points, $body_color, $border_color = null, $border_width = 0, $title = null)
|
||||
{
|
||||
$point_pairs = array();
|
||||
$this_pair = array();
|
||||
|
||||
if(isset($points[0]) && is_array($points[0]) && count($points[0]) >= 2)
|
||||
{
|
||||
foreach($points as $point_set)
|
||||
{
|
||||
array_push($point_pairs, implode(',', array_slice($point_set, 0, 2)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($points as $one_point)
|
||||
{
|
||||
array_push($this_pair, $one_point);
|
||||
|
||||
if(count($this_pair) == 2)
|
||||
{
|
||||
$pair = implode(',', $this_pair);
|
||||
array_push($point_pairs, $pair);
|
||||
$this_pair = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$polygon = $this->image->createElement('polygon');
|
||||
$polygon->setAttribute('fill', $body_color);
|
||||
|
||||
if($border_width > 0)
|
||||
{
|
||||
$polygon->setAttribute('stroke', $border_color);
|
||||
$polygon->setAttribute('stroke-width', $border_width);
|
||||
$polygon->setAttribute('points', implode(' ', $point_pairs));
|
||||
}
|
||||
|
||||
if($title != null)
|
||||
{
|
||||
$polygon->setAttribute('xlink:title', $title);
|
||||
/*static $id_counter = 0;
|
||||
$id_counter++;
|
||||
$polygon->setAttribute('id', 'phover' . $id_counter);
|
||||
|
||||
$text = $this->image->createElement('text');
|
||||
$text->setAttribute('id', 'po' . $id_counter);
|
||||
$text->setAttribute('fill', $border_color);
|
||||
//$text->setAttribute('font-size', '30');
|
||||
$text->setAttribute('visibility', 'hidden');
|
||||
$xy = explode(',', $point_pairs[0]);
|
||||
$text->setAttribute('x', array_shift($xy));
|
||||
$text->setAttribute('y', array_shift($xy));
|
||||
|
||||
$string = $this->image->createTextNode($title);
|
||||
$text->appendChild($string);
|
||||
|
||||
$set = $this->image->createElement('set');
|
||||
$set->setAttribute('attributeName', 'visibility');
|
||||
$set->setAttribute('from', 'hidden');
|
||||
$set->setAttribute('to', 'visible');
|
||||
$set->setAttribute('begin', 'phover' . $id_counter . '.mouseover');
|
||||
$set->setAttribute('end', 'phover' . $id_counter . '.mouseout');
|
||||
$text->appendChild($set);
|
||||
$this->svg->appendChild($polygon);
|
||||
$this->svg->appendChild($text);*/
|
||||
}
|
||||
|
||||
$this->svg->appendChild($polygon);
|
||||
}
|
||||
public function draw_ellipse($center_x, $center_y, $width, $height, $body_color, $border_color = null, $border_width = 0, $default_hide = false, $title = null)
|
||||
{
|
||||
$ellipse = $this->image->createElement('ellipse');
|
||||
$ellipse->setAttribute('cx', $center_x);
|
||||
$ellipse->setAttribute('cy', $center_y);
|
||||
$ellipse->setAttribute('rx', floor($width / 2));
|
||||
$ellipse->setAttribute('ry', floor($height / 2));
|
||||
$ellipse->setAttribute('stroke', $border_color);
|
||||
$ellipse->setAttribute('fill', $body_color);
|
||||
$ellipse->setAttribute('stroke-width', $border_width);
|
||||
|
||||
if($title != null)
|
||||
{
|
||||
$ellipse->setAttribute('xlink:title', $title);
|
||||
}
|
||||
|
||||
if($default_hide)
|
||||
{ return; // TODO: get working correctly
|
||||
$in = $this->image->createElement('set');
|
||||
$in->setAttribute('attributeName', 'stroke-opacity');
|
||||
$in->setAttribute('from', 0);
|
||||
$in->setAttribute('to', '1');
|
||||
$in->setAttribute('begin', 'mouseover');
|
||||
$in->setAttribute('end', 'mouseout');
|
||||
$ellipse->appendChild($in);
|
||||
|
||||
$out = $this->image->createElement('set');
|
||||
$out->setAttribute('attributeName', 'fill-opacity');
|
||||
$out->setAttribute('from', 0);
|
||||
$out->setAttribute('to', 1);
|
||||
$out->setAttribute('begin', 'mouseover');
|
||||
$out->setAttribute('end', 'mouseout');
|
||||
$ellipse->appendChild($out);
|
||||
}
|
||||
|
||||
$this->svg->appendChild($ellipse);
|
||||
}
|
||||
public function draw_line($start_x, $start_y, $end_x, $end_y, $color, $line_width = 1, $title = null)
|
||||
{
|
||||
$line = $this->image->createElement('line');
|
||||
$line->setAttribute('x1', $start_x);
|
||||
$line->setAttribute('y1', $start_y);
|
||||
$line->setAttribute('x2', $end_x);
|
||||
$line->setAttribute('y2', $end_y);
|
||||
$line->setAttribute('stroke', $color);
|
||||
$line->setAttribute('stroke-width', $line_width);
|
||||
|
||||
if($title != null)
|
||||
{
|
||||
$line->setAttribute('xlink:title', $title);
|
||||
}
|
||||
|
||||
$this->svg->appendChild($line);
|
||||
}
|
||||
public function draw_dashed_line($start_x, $start_y, $end_x, $end_y, $color, $line_width, $dash_length, $blank_length)
|
||||
{
|
||||
$line = $this->image->createElement('line');
|
||||
$line->setAttribute('x1', round($start_x));
|
||||
$line->setAttribute('y1', round($start_y));
|
||||
$line->setAttribute('x2', round($end_x));
|
||||
$line->setAttribute('y2', round($end_y));
|
||||
$line->setAttribute('stroke', $color);
|
||||
$line->setAttribute('stroke-width', $line_width);
|
||||
$line->setAttribute('stroke-dasharray', $dash_length . ',' . $blank_length);
|
||||
|
||||
$this->svg->appendChild($line);
|
||||
}
|
||||
public function draw_poly_line($x_y_pair_array, $color, $line_width = 1)
|
||||
{
|
||||
foreach($x_y_pair_array as &$x_y)
|
||||
{
|
||||
$x_y = round($x_y[0]) . ',' . round($x_y[1]);
|
||||
}
|
||||
$poly_points = implode(' ', $x_y_pair_array);
|
||||
|
||||
$polyline = $this->image->createElement('polyline');
|
||||
$polyline->setAttribute('stroke', $color);
|
||||
$polyline->setAttribute('stroke-width', $line_width);
|
||||
$polyline->setAttribute('fill', 'none');
|
||||
$polyline->setAttribute('points', implode(' ', $x_y_pair_array));
|
||||
|
||||
$this->svg->appendChild($polyline);
|
||||
}
|
||||
public function png_image_to_type($file)
|
||||
{
|
||||
return $file;
|
||||
}
|
||||
public function jpg_image_to_type($file)
|
||||
{
|
||||
return $file;
|
||||
}
|
||||
public function image_copy_merge($source_image_object, $to_x, $to_y, $source_x = 0, $source_y = 0, $width = -1, $height = -1)
|
||||
{
|
||||
$image = $this->image->createElement('image');
|
||||
$image->setAttribute('x', $to_x);
|
||||
$image->setAttribute('y', $to_y);
|
||||
$image->setAttribute('width', $width);
|
||||
$image->setAttribute('height', $height);
|
||||
$image->setAttribute('xlink:href', $source_image_object);
|
||||
|
||||
|
||||
if($source_image_object instanceof pts_graph_ir_value && $source_image_object->get_attribute('href') != null)
|
||||
{
|
||||
$link = $this->image->createElement('a');
|
||||
$link->setAttribute('xlink:href', $source_image_object->get_attribute('href'));
|
||||
$link->setAttribute('xlink:show', 'new');
|
||||
$link->appendChild($image);
|
||||
$this->svg->appendChild($link);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->svg->appendChild($image);
|
||||
}
|
||||
}
|
||||
public function convert_hex_to_type($hex)
|
||||
{
|
||||
if(($short = substr($hex, 1, 3)) == substr($hex, 4, 3))
|
||||
{
|
||||
// very basic shortening, but could do it more properly to find #XXYYZZ collapsing to #XYZ
|
||||
$hex = '#' . $short;
|
||||
}
|
||||
|
||||
return $hex;
|
||||
}
|
||||
public function convert_type_to_hex($type)
|
||||
{
|
||||
if(strlen($type) == 4)
|
||||
{
|
||||
$type .= substr($type, 1);
|
||||
}
|
||||
|
||||
return $type;
|
||||
}
|
||||
public function text_string_dimensions($string, $font_type, $font_size, $predefined_string = false)
|
||||
{
|
||||
return array(0, 0); // TODO: implement, though seems to do fine without it for the SVG renderer
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,284 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2010, Phoronix Media
|
||||
Copyright (C) 2008 - 2010, Michael Larabel
|
||||
bilde_swf_renderer: The SWF (Flash) rendering implementation for bilde_renderer.
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class bilde_swf_renderer extends bilde_renderer
|
||||
{
|
||||
private $swf_font = null;
|
||||
public $renderer = "SWF";
|
||||
|
||||
public function __construct($width, $height, $embed_identifiers = "")
|
||||
{
|
||||
$this->image = new SWFMovie();
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
$this->image->setDimension($width, $height);
|
||||
|
||||
$this->swf_font = new SWFFont("_sans"); // TODO: Implement better font support
|
||||
}
|
||||
public static function renderer_supported()
|
||||
{
|
||||
return extension_loaded("ming");
|
||||
}
|
||||
public function html_embed_code($file_name, $attributes = null, $is_xsl = false)
|
||||
{
|
||||
$file_name = str_replace("BILDE_EXTENSION", strtolower($this->get_renderer()), $file_name);
|
||||
$attributes = pts_arrays::to_array($attributes);
|
||||
$attributes["value"] = $file_name;
|
||||
$attributes["src"] = $file_name;
|
||||
|
||||
if($is_xsl)
|
||||
{
|
||||
$html = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"objects\"><param name=\"movie\">";
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= "<xsl:attribute name=\"" . $option . "\">" . $value . "</xsl:attribute>";
|
||||
}
|
||||
|
||||
$html .= "</param><embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= "<xsl:attribute name=\"" . $option . "\">" . $value . "</xsl:attribute>";
|
||||
}
|
||||
|
||||
$html .= "</embed></object>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"objects\"><param name=\"movie\" ";
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= $option . "=\"" . $value . "\" ";
|
||||
}
|
||||
|
||||
$html .= "></param><embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" ";
|
||||
|
||||
foreach($attributes as $option => $value)
|
||||
{
|
||||
$html .= $option . "=\"" . $value . "\" ";
|
||||
}
|
||||
|
||||
$html .= "></embed></object>";
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
public function render_image($output_file = null, $quality = 100)
|
||||
{
|
||||
return $this->image->save($output_file);
|
||||
}
|
||||
public function resize_image($width, $height)
|
||||
{
|
||||
$this->image_width = $width;
|
||||
$this->image_height = $height;
|
||||
$this->image->setDimension($width, $height);
|
||||
}
|
||||
public function destroy_image()
|
||||
{
|
||||
$this->image = null;
|
||||
}
|
||||
|
||||
public function write_text_left($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
$this->write_swf_text($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text, "LEFT");
|
||||
}
|
||||
public function draw_arc($center_x, $center_y, $radius, $offset_percent, $percent, $body_color, $border_color = null, $border_width = 1, $title = null)
|
||||
{
|
||||
return false; // TODO: implement
|
||||
}
|
||||
public function write_text_right($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
$this->write_swf_text($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text, "RIGHT");
|
||||
}
|
||||
public function write_text_center($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text = false)
|
||||
{
|
||||
$this->write_swf_text($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text, "CENTER");
|
||||
}
|
||||
|
||||
public function draw_rectangle($x1, $y1, $width, $height, $background_color)
|
||||
{
|
||||
$points = array(
|
||||
$x1, $y1,
|
||||
$width, $y1,
|
||||
$width, $height,
|
||||
$x1, $height
|
||||
);
|
||||
$this->draw_polygon($points, $background_color, $background_color, 1);
|
||||
}
|
||||
public function draw_rectangle_border($x1, $y1, $width, $height, $border_color)
|
||||
{
|
||||
$points = array(
|
||||
$x1, $y1,
|
||||
$width, $y1,
|
||||
$width, $height,
|
||||
$x1, $height
|
||||
);
|
||||
$this->draw_polygon($points, null, $border_color, 1);
|
||||
}
|
||||
public function draw_polygon($points, $body_color, $border_color = null, $border_width = 0)
|
||||
{
|
||||
$poly = new SWFShape();
|
||||
|
||||
if(!empty($body_color))
|
||||
{
|
||||
$poly->setLeftFill($body_color[0], $body_color[1], $body_color[2]);
|
||||
}
|
||||
if(!empty($border_color) && $border_width > 0)
|
||||
{
|
||||
$poly->setLine($border_width, $border_color[0], $border_color[1], $border_color[2]);
|
||||
}
|
||||
|
||||
|
||||
$point_pairs = array();
|
||||
$this_pair = array();
|
||||
|
||||
foreach($points as $one_point)
|
||||
{
|
||||
array_push($this_pair, $one_point);
|
||||
|
||||
if(count($this_pair) == 2)
|
||||
{
|
||||
array_push($point_pairs, $this_pair);
|
||||
$this_pair = array();
|
||||
}
|
||||
}
|
||||
|
||||
if(count($point_pairs) > 1)
|
||||
{
|
||||
$poly->movePenTo($point_pairs[0][0], $point_pairs[0][1]);
|
||||
|
||||
for($i = 1; $i < count($point_pairs); $i++)
|
||||
{
|
||||
$poly->drawLineTo($point_pairs[$i][0], $point_pairs[$i][1]);
|
||||
}
|
||||
$poly->drawLineTo($point_pairs[0][0], $point_pairs[0][1]);
|
||||
}
|
||||
|
||||
$this->image->add($poly);
|
||||
}
|
||||
public function draw_ellipse($center_x, $center_y, $width, $height, $body_color, $border_color = null, $border_width = 0, $default_hide = false)
|
||||
{
|
||||
if($default_hide == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($width > $height)
|
||||
{
|
||||
$base_size = $width;
|
||||
}
|
||||
else
|
||||
{
|
||||
$base_size = $height;
|
||||
}
|
||||
|
||||
$ellipse = new SWFShape();
|
||||
$ellipse->setLine($border_width, $border_color[0], $border_color[1], $border_color[2]);
|
||||
$ellipse->setRightFill($body_color[0], $body_color[1], $body_color[2]);
|
||||
$ellipse->drawCircle($base_size / 2);
|
||||
$added = $this->image->add($ellipse);
|
||||
|
||||
$added->moveTo($center_x, $center_y);
|
||||
$added->scaleTo(($width / $base_size), ($height / $base_size));
|
||||
}
|
||||
public function draw_line($start_x, $start_y, $end_x, $end_y, $color, $line_width = 1, $title = null)
|
||||
{
|
||||
$line = new SWFShape();
|
||||
$line->setLine(1, $color[0], $color[1], $color[2]);
|
||||
$line->movePenTo($start_x, $start_y);
|
||||
$line->drawLineTo($end_x, $end_y);
|
||||
$added = $this->image->add($line);
|
||||
}
|
||||
|
||||
public function png_image_to_type($file)
|
||||
{
|
||||
return new SWFBitmap(fopen($file, "rb"));
|
||||
}
|
||||
public function jpg_image_to_type($file)
|
||||
{
|
||||
return new SWFBitmap(fopen($file, "rb"));
|
||||
}
|
||||
public function image_copy_merge($source_image_object, $to_x, $to_y, $source_x = 0, $source_y = 0, $width = -1, $height = -1)
|
||||
{
|
||||
// TODO: $source_x, $source_y, $width, $height need to be implemented
|
||||
$added = $this->image->add($source_image_object);
|
||||
$added->moveTo($to_x, $to_y);
|
||||
}
|
||||
public function convert_hex_to_type($hex)
|
||||
{
|
||||
return array(hexdec(substr($hex, 1, 2)), hexdec(substr($hex, 3, 2)), hexdec(substr($hex, 5, 2)));
|
||||
}
|
||||
public function convert_type_to_hex($type)
|
||||
{
|
||||
return '#' . dexhec($type[0]) . dexhec($type[1]) . dexhec($type[2]);
|
||||
}
|
||||
public function text_string_dimensions($string, $font_type, $font_size, $predefined_string = false)
|
||||
{
|
||||
return array(0, 0);
|
||||
}
|
||||
|
||||
// Privates
|
||||
|
||||
private function write_swf_text($text_string, $font_type, $font_size, $font_color, $bound_x1, $bound_y1, $bound_x2, $bound_y2, $rotate_text, $orientation = "LEFT")
|
||||
{
|
||||
switch($orientation)
|
||||
{
|
||||
case "CENTER":
|
||||
$align = SWFTEXTFIELD_ALIGN_CENTER;
|
||||
break;
|
||||
case "RIGHT":
|
||||
if($bound_x1 == $bound_x2)
|
||||
{
|
||||
$bound_x1 -= $this->image_width;
|
||||
}
|
||||
|
||||
$align = SWFTEXTFIELD_ALIGN_RIGHT;
|
||||
break;
|
||||
case "LEFT":
|
||||
default:
|
||||
$align = SWFTEXTFIELD_ALIGN_LEFT;
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: Implement $font_type, $rotate_text support
|
||||
$t = new SWFTextField();
|
||||
$t->setFont($this->swf_font);
|
||||
$t->setColor($font_color[0], $font_color[1], $font_color[2]);
|
||||
$t->setHeight($font_size);
|
||||
|
||||
if(($width = abs($bound_x1 - $bound_x2)) > 0)
|
||||
{
|
||||
$t->setBounds(abs($bound_x1 - $bound_x2), $font_size);
|
||||
}
|
||||
|
||||
$t->align($align);
|
||||
$t->addString($text_string);
|
||||
|
||||
$added = $this->image->add($t);
|
||||
$added->moveTo($bound_x1, $bound_y1);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
123
pts-core/objects/client/display_modes/pts_short_display_mode.php
Normal file
123
pts-core/objects/client/display_modes/pts_short_display_mode.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2015, Phoronix Media
|
||||
Copyright (C) 2015, Michael Larabel
|
||||
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class pts_short_display_mode extends pts_concise_display_mode
|
||||
{
|
||||
private $longest_test_identifier_length = 0;
|
||||
|
||||
public function test_run_process_start(&$test_run_manager)
|
||||
{
|
||||
foreach($test_run_manager->get_tests_to_run() as $test)
|
||||
{
|
||||
$ti = $test->test_profile->get_identifier();
|
||||
|
||||
if(strlen($ti) > $this->longest_test_identifier_length)
|
||||
{
|
||||
$this->longest_test_identifier_length = strlen($ti);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
protected function print_test_identifier_prefix($test)
|
||||
{
|
||||
$ti = $test->test_profile->get_identifier();
|
||||
return $ti . str_repeat(' ', ($this->longest_test_identifier_length - strlen($ti))) . ': ';
|
||||
}
|
||||
public function test_run_start(&$test_run_manager, &$test_result)
|
||||
{
|
||||
echo $this->print_test_identifier_prefix($test_result);
|
||||
|
||||
if(($test_description = $test_result->get_arguments_description()) != false)
|
||||
{
|
||||
echo pts_client::swap_variables($test_description, array('pts_client', 'environmental_variables'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Test Starting';
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
$this->trial_run_count_current = 0;
|
||||
$this->expected_trial_run_count = $test_result->test_profile->get_times_to_run();
|
||||
}
|
||||
public function test_run_instance_error($error_string)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function test_run_instance_output(&$to_output)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function test_run_message($message_string)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function test_run_error($error_string)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function test_run_instance_header(&$test_result)
|
||||
{
|
||||
$this->trial_run_count_current++;
|
||||
echo $this->print_test_identifier_prefix($test_result) . 'Started Run ' . $this->trial_run_count_current . ' @ ' . date('H:i:s') . PHP_EOL;
|
||||
}
|
||||
public function test_run_instance_complete(&$test_result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function test_run_end(&$test_result)
|
||||
{
|
||||
if(in_array($test_result->test_profile->get_display_format(), array('NO_RESULT', 'IMAGE_COMPARISON')))
|
||||
{
|
||||
$end_print = null;
|
||||
}
|
||||
else if(in_array($test_result->test_profile->get_display_format(), array('PASS_FAIL', 'MULTI_PASS_FAIL')))
|
||||
{
|
||||
$end_print = 'Final: ' . $test_result->get_result() . ' (' . $test_result->test_profile->get_result_scale() . ')';
|
||||
}
|
||||
else if(in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH')))
|
||||
{
|
||||
$values = explode(',', $test_result->get_result());
|
||||
$end_print = null;
|
||||
|
||||
if(count($values) > 1)
|
||||
{
|
||||
$avg = pts_math::set_precision(array_sum($values) / count($values), 2);
|
||||
$min = pts_math::set_precision(min($values), 2);
|
||||
$max = pts_math::set_precision(max($values), 2);
|
||||
$end_print .= 'AVG: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
|
||||
$end_print .= 'MIN: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
|
||||
$end_print .= 'MAX: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ') / ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$end_print = pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->get_result() . ' ' . $test_result->test_profile->get_result_scale();
|
||||
}
|
||||
|
||||
echo $this->print_test_identifier_prefix($test_result) . $end_print;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -27,6 +27,7 @@ class pts_client
|
||||
private static $current_command = null;
|
||||
protected static $lock_pointers = null;
|
||||
private static $forked_pids = array();
|
||||
protected static $phoromatic_servers = array();
|
||||
|
||||
public static function create_lock($lock_file)
|
||||
{
|
||||
@@ -44,7 +45,7 @@ class pts_client
|
||||
set_time_limit(0);
|
||||
pts_define_directories(); // Define directories
|
||||
|
||||
if(function_exists('cli_set_process_title'))
|
||||
if(function_exists('cli_set_process_title') && !phodevi::is_macosx())
|
||||
{
|
||||
cli_set_process_title('Phoronix Test Suite');
|
||||
}
|
||||
@@ -452,7 +453,7 @@ class pts_client
|
||||
|
||||
return $real_name;
|
||||
}
|
||||
public static function init_display_mode($flags = 0)
|
||||
public static function init_display_mode($flags = 0, $override_display_mode = false)
|
||||
{
|
||||
if(PTS_IS_WEB_CLIENT && !defined('PHOROMATIC_SERVER'))
|
||||
{
|
||||
@@ -460,7 +461,7 @@ class pts_client
|
||||
return;
|
||||
}
|
||||
|
||||
$env_mode = ($flags & pts_c::debug_mode) ? 'BASIC' : false;
|
||||
$env_mode = ($flags & pts_c::debug_mode) ? 'BASIC' : $override_display_mode;
|
||||
|
||||
switch(($env_mode != false || ($env_mode = pts_client::read_env('PTS_DISPLAY_MODE')) != false ? $env_mode : pts_config::read_user_config('PhoronixTestSuite/Options/General/DefaultDisplayMode', 'DEFAULT')))
|
||||
{
|
||||
@@ -471,6 +472,9 @@ class pts_client
|
||||
case 'CONCISE':
|
||||
self::$display = new pts_concise_display_mode();
|
||||
break;
|
||||
case 'SHORT':
|
||||
self::$display = new pts_short_display_mode();
|
||||
break;
|
||||
case 'DEFAULT':
|
||||
default:
|
||||
self::$display = new pts_concise_display_mode();
|
||||
@@ -723,11 +727,20 @@ class pts_client
|
||||
// Archive to disk
|
||||
$pso->save_to_file(PTS_CORE_STORAGE);
|
||||
}
|
||||
public static function register_phoromatic_server($server_ip, $http_port)
|
||||
{
|
||||
array_push(self::$phoromatic_servers, array('ip' => $server_ip, 'http_port' => $http_port));
|
||||
}
|
||||
public static function available_phoromatic_servers()
|
||||
{
|
||||
$phoromatic_servers = array();
|
||||
$possible_servers = pts_network::find_zeroconf_phoromatic_servers(true);
|
||||
|
||||
foreach(self::$phoromatic_servers as $server)
|
||||
{
|
||||
array_push($possible_servers, array($server['ip'], $server['http_port']));
|
||||
}
|
||||
|
||||
$user_config_phoromatic_servers = pts_config::read_user_config('PhoronixTestSuite/Options/General/PhoromaticServers', '');
|
||||
foreach(explode(',', $user_config_phoromatic_servers) as $static_server)
|
||||
{
|
||||
@@ -784,7 +797,7 @@ class pts_client
|
||||
$config_md5 = $pso->read_object('user_agreement_cs');
|
||||
$current_md5 = md5_file(PTS_PATH . 'pts-core/user-agreement.txt');
|
||||
|
||||
if(($config_md5 != $current_md5 || pts_config::read_user_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting', 'UNKNOWN') == 'UNKNOWN') && !PTS_IS_DAEMONIZED_SERVER_PROCESS)
|
||||
if(($config_md5 != $current_md5 || pts_config::read_user_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting', 'UNKNOWN') == 'UNKNOWN') && !PTS_IS_DAEMONIZED_SERVER_PROCESS && getenv('PTS_SILENT_MODE') != 1 && $config_md5 != 'enterprise-agree')
|
||||
{
|
||||
$prompt_in_method = pts_client::check_command_for_function($command, 'pts_user_agreement_prompt');
|
||||
$user_agreement = file_get_contents(PTS_PATH . 'pts-core/user-agreement.txt');
|
||||
@@ -797,24 +810,22 @@ class pts_client
|
||||
{
|
||||
if(count($user_agreement_return) == 3)
|
||||
{
|
||||
list($agree, $usage_reporting, $hwsw_reporting) = $user_agreement_return;
|
||||
list($agree, $usage_reporting) = $user_agreement_return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$agree = array_shift($user_agreement_return);
|
||||
$usage_reporting = -1;
|
||||
$hwsw_reporting = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$agree = $user_agreement_return;
|
||||
$usage_reporting = -1;
|
||||
$hwsw_reporting = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if($prompt_in_method == false || $usage_reporting == -1 || $hwsw_reporting == -1)
|
||||
if($prompt_in_method == false || $usage_reporting == -1)
|
||||
{
|
||||
pts_client::$display->generic_heading('User Agreement');
|
||||
echo wordwrap($user_agreement, 65);
|
||||
@@ -823,12 +834,10 @@ class pts_client
|
||||
if(pts_flags::no_openbenchmarking_reporting())
|
||||
{
|
||||
$usage_reporting = false;
|
||||
$hwsw_reporting = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$usage_reporting = $agree ? pts_user_io::prompt_bool_input('Enable anonymous usage / statistics reporting', true) : -1;
|
||||
$hwsw_reporting = $agree ? pts_user_io::prompt_bool_input('Enable anonymous statistical reporting of installed software / hardware', true) : -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,10 +853,7 @@ class pts_client
|
||||
}
|
||||
|
||||
pts_config::user_config_generate(array(
|
||||
'PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting' => pts_config::bool_to_string($usage_reporting),
|
||||
'PhoronixTestSuite/Options/OpenBenchmarking/AnonymousHardwareReporting' => pts_config::bool_to_string($hwsw_reporting),
|
||||
'PhoronixTestSuite/Options/OpenBenchmarking/AnonymousSoftwareReporting' => pts_config::bool_to_string($hwsw_reporting)
|
||||
));
|
||||
'PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting' => pts_config::bool_to_string($usage_reporting)));
|
||||
}
|
||||
}
|
||||
public static function swap_variables($user_str, $replace_call)
|
||||
@@ -1012,7 +1018,7 @@ class pts_client
|
||||
|
||||
return $raw_xsl;
|
||||
}
|
||||
public static function generate_result_file_graphs($test_results_identifier, $save_to_dir = false)
|
||||
public static function generate_result_file_graphs($test_results_identifier, $save_to_dir = false, $extra_attributes = null)
|
||||
{
|
||||
if($save_to_dir)
|
||||
{
|
||||
@@ -1026,7 +1032,14 @@ class pts_client
|
||||
}
|
||||
}
|
||||
|
||||
$result_file = new pts_result_file($test_results_identifier);
|
||||
if($test_results_identifier instanceof pts_result_file)
|
||||
{
|
||||
$result_file = &$test_results_identifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_file = new pts_result_file($test_results_identifier);
|
||||
}
|
||||
|
||||
$generated_graphs = array();
|
||||
$generated_graph_tables = false;
|
||||
@@ -1070,7 +1083,7 @@ class pts_client
|
||||
|
||||
if(PTS_IS_CLIENT)
|
||||
{
|
||||
if($result_file->is_multi_way_comparison() || pts_client::read_env('GRAPH_GROUP_SIMILAR'))
|
||||
if($result_file->is_multi_way_comparison(null, $extra_attributes) || pts_client::read_env('GRAPH_GROUP_SIMILAR'))
|
||||
{
|
||||
$table_keys = array();
|
||||
$titles = $result_file->get_test_titles();
|
||||
@@ -1095,7 +1108,7 @@ class pts_client
|
||||
}
|
||||
}
|
||||
|
||||
$graph = pts_render::render_graph($result_object, $result_file, $save_to);
|
||||
$graph = pts_render::render_graph($result_object, $result_file, $save_to, $extra_attributes);
|
||||
array_push($generated_graphs, $graph);
|
||||
}
|
||||
|
||||
@@ -1403,106 +1416,6 @@ class pts_client
|
||||
|
||||
return $terminal_width;
|
||||
}
|
||||
public static function user_hardware_software_reporting()
|
||||
{
|
||||
$hw_reporting = pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousHardwareReporting', 'FALSE');
|
||||
$sw_reporting = pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousSoftwareReporting', 'FALSE');
|
||||
|
||||
if($hw_reporting == false && $sw_reporting == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$hw = array();
|
||||
$sw = array();
|
||||
$pso = pts_storage_object::recover_from_file(PTS_CORE_STORAGE);
|
||||
|
||||
if($hw_reporting)
|
||||
{
|
||||
$hw = array();
|
||||
foreach(pts_openbenchmarking::stats_hardware_list() as $key => $value)
|
||||
{
|
||||
if(count($value) == 2)
|
||||
{
|
||||
$hw[$key] = phodevi::read_property($value[0], $value[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hw[$key] = phodevi::read_name($value[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$hw_prev = $pso->read_object('global_reported_hw');
|
||||
$pso->add_object('global_reported_hw', $hw);
|
||||
|
||||
if(is_array($hw_prev))
|
||||
{
|
||||
$hw = array_diff_assoc($hw, $hw_prev);
|
||||
}
|
||||
|
||||
// Check the PCI devices
|
||||
$pci = phodevi::read_property('motherboard', 'pci-devices');
|
||||
$pci_prev = $pso->read_object('global_reported_pci');
|
||||
$pso->add_object('global_reported_pci', $pci);
|
||||
|
||||
if(!empty($pci_prev) && is_array($pci_prev) && is_array($pci))
|
||||
{
|
||||
if($pci == $pci_prev)
|
||||
{
|
||||
$pci = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pci = @array_diff($pci, $pci_prev);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($pci))
|
||||
{
|
||||
pts_openbenchmarking_client::upload_pci_data($pci);
|
||||
}
|
||||
|
||||
// Check the USB devices
|
||||
$usb = phodevi::read_property('motherboard', 'usb-devices');
|
||||
$usb_prev = $pso->read_object('global_reported_usb');
|
||||
$pso->add_object('global_reported_usb', $usb);
|
||||
|
||||
if(!empty($usb_prev) && is_array($usb_prev) && is_array($usb) && $usb != $usb_prev)
|
||||
{
|
||||
pts_openbenchmarking_client::upload_usb_data($usb);
|
||||
}
|
||||
}
|
||||
if($sw_reporting)
|
||||
{
|
||||
$sw = array();
|
||||
foreach(pts_openbenchmarking::stats_software_list() as $key => $value)
|
||||
{
|
||||
if(count($value) == 2)
|
||||
{
|
||||
$sw[$key] = phodevi::read_property($value[0], $value[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sw[$key] = phodevi::read_name($value[0]);
|
||||
}
|
||||
}
|
||||
$sw_prev = $pso->read_object('global_reported_sw');
|
||||
$pso->add_object('global_reported_sw', $sw);
|
||||
|
||||
if(is_array($sw_prev))
|
||||
{
|
||||
$sw = array_diff_assoc($sw, $sw_prev);
|
||||
}
|
||||
}
|
||||
|
||||
$to_report = array_merge($hw, $sw);
|
||||
$pso->save_to_file(PTS_CORE_STORAGE);
|
||||
|
||||
if(!empty($to_report))
|
||||
{
|
||||
pts_openbenchmarking_client::upload_hwsw_data($to_report);
|
||||
}
|
||||
}
|
||||
public static function is_process_running($process)
|
||||
{
|
||||
if(phodevi::is_linux())
|
||||
@@ -1624,7 +1537,7 @@ class pts_client
|
||||
|
||||
if(!isset($cache[$executable]) || $ignore_paths_with)
|
||||
{
|
||||
$paths = pts_strings::trim_explode((phodevi::is_windows() ? ';' : ':'), (($path = pts_client::read_env('PATH')) == false ? '/usr/bin:/usr/local/bin' : $path));
|
||||
$paths = pts_strings::trim_explode((phodevi::is_windows() ? ';' : ':'), (($path = pts_client::read_env('PATH')) == false ? '/usr/local/bin:/usr/bin:/usr/sbin:/bin' : $path));
|
||||
$executable_path = false;
|
||||
|
||||
foreach($paths as $path)
|
||||
@@ -1766,7 +1679,7 @@ class pts_client
|
||||
return;
|
||||
}
|
||||
|
||||
if(function_exists('pcntl_fork'))
|
||||
if(function_exists('pcntl_fork') && function_exists('posix_setsid'))
|
||||
{
|
||||
$current_pid = function_exists('posix_getpid') ? posix_getpid() : -1;
|
||||
$pid = pcntl_fork();
|
||||
@@ -1812,7 +1725,7 @@ class pts_client
|
||||
$function = implode(':', $function);
|
||||
}
|
||||
|
||||
trigger_error('php-pcntl must be installed for calling ' . $function . '.', E_USER_ERROR);
|
||||
trigger_error('php-pcntl and php-posix must be installed for calling ' . $function . '.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
public static function fork($fork_function, $fork_function_parameters)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -30,19 +30,17 @@ class pts_config
|
||||
{
|
||||
static $init_process_ran = false;
|
||||
static $xml_user_config = null;
|
||||
private static $config_file_location = null;
|
||||
|
||||
public static function get_config_file_location()
|
||||
{
|
||||
if(self::$config_file_location == null)
|
||||
if(PTS_IS_DAEMONIZED_SERVER_PROCESS || (is_file('/etc/phoronix-test-suite.xml') && is_writable('/etc/phoronix-test-suite.xml')))
|
||||
{
|
||||
if(PTS_IS_DAEMONIZED_SERVER_PROCESS)
|
||||
self::$config_file_location = '/etc/phoronix-test-suite.xml';
|
||||
else
|
||||
self::$config_file_location = PTS_USER_PATH . 'user-config.xml';
|
||||
return '/etc/phoronix-test-suite.xml';
|
||||
}
|
||||
else
|
||||
{
|
||||
return PTS_USER_PATH . 'user-config.xml';
|
||||
}
|
||||
|
||||
return self::$config_file_location;
|
||||
}
|
||||
public static function init_files()
|
||||
{
|
||||
@@ -91,12 +89,9 @@ class pts_config
|
||||
// Validate the config files, update them (or write them) if needed, and other configuration file tasks
|
||||
|
||||
$read_config = new pts_config_nye_XmlReader($new_config_values);
|
||||
|
||||
$config = new nye_XmlWriter('xsl/pts-user-config-viewer.xsl');
|
||||
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting', $read_config);
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousSoftwareReporting', $read_config);
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousHardwareReporting', $read_config);
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/OpenBenchmarking/IndexCacheTTL', $read_config);
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/OpenBenchmarking/AlwaysUploadSystemLogs', $read_config);
|
||||
|
||||
@@ -148,7 +143,12 @@ class pts_config
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/Server/AdvertiseServiceZeroConf', $read_config);
|
||||
$config->addXmlNodeFromReader('PhoronixTestSuite/Options/Server/PhoromaticStorage', $read_config);
|
||||
|
||||
$config->saveXMLFile(pts_config::get_config_file_location());
|
||||
$config_file = pts_config::get_config_file_location();
|
||||
if($read_config->times_fallback() > 0 || !is_file($config_file))
|
||||
{
|
||||
// Something changed, so write out file, otherwise don't bother writing file
|
||||
$config->saveXMLFile($config_file);
|
||||
}
|
||||
}
|
||||
public static function bool_to_string($bool)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ class pts_documentation
|
||||
}
|
||||
public static function basic_description()
|
||||
{
|
||||
return 'The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.';
|
||||
return 'The **Phoronix Test Suite** is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014, Phoronix Media
|
||||
Copyright (C) 2014, Michael Larabel
|
||||
Copyright (C) 2014 - 2015, Phoronix Media
|
||||
Copyright (C) 2014 - 2015, Michael Larabel
|
||||
pts_logger.php: A simple log file generator
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -60,6 +60,10 @@ class pts_logger
|
||||
|
||||
file_put_contents($this->log_file, '[' . date('D M ' . str_pad(date('j'), 2, ' ', STR_PAD_LEFT) . ' H:i:s Y') . '] ' . $message . PHP_EOL, FILE_APPEND);
|
||||
}
|
||||
public function get_log_file_size()
|
||||
{
|
||||
return is_file($this->log_file) ? filesize($this->log_file) : 0;
|
||||
}
|
||||
public function get_log_file_location()
|
||||
{
|
||||
return $this->log_file;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
pts_module_interface.php: The generic Phoronix Test Suite module object that is extended by the specific modules/plug-ins
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -115,9 +115,12 @@ class pts_module_manager
|
||||
{
|
||||
foreach(explode(';', $env_var_string) as $ev)
|
||||
{
|
||||
list($var, $value) = pts_strings::trim_explode('=', $ev);
|
||||
pts_client::set_environment_variable($var, $value);
|
||||
pts_module_manager::var_store_add($var, $value);
|
||||
if(strpos($ev, '=') != false)
|
||||
{
|
||||
list($var, $value) = pts_strings::trim_explode('=', $ev);
|
||||
pts_client::set_environment_variable($var, $value);
|
||||
pts_module_manager::var_store_add($var, $value);
|
||||
}
|
||||
}
|
||||
|
||||
pts_module_manager::detect_modules_to_load();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2014, Phoronix Media
|
||||
Copyright (C) 2010 - 2014, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -40,16 +40,6 @@ class pts_openbenchmarking_client
|
||||
$results_identifier = null;
|
||||
}
|
||||
|
||||
// Validate the XML
|
||||
// Rely upon server-side validation in case of additions to the spec later on as might be a problem with the JSON addition
|
||||
/*
|
||||
if($result_file->xml_parser->validate() == false)
|
||||
{
|
||||
echo PHP_EOL . 'Errors occurred parsing the result file XML.' . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
// Ensure the results can be shared
|
||||
if(self::result_upload_supported($result_file) == false)
|
||||
{
|
||||
@@ -62,25 +52,29 @@ class pts_openbenchmarking_client
|
||||
return false;
|
||||
}
|
||||
|
||||
$composite_xml = $result_file->xml_parser->getXML();
|
||||
$composite_xml = $result_file->getRawXml();
|
||||
$system_log_dir = PTS_SAVE_RESULTS_PATH . $result_file->get_identifier() . '/system-logs/';
|
||||
$upload_system_logs = false;
|
||||
|
||||
if(pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AlwaysUploadSystemLogs', 'FALSE'))
|
||||
if(is_dir($system_log_dir))
|
||||
{
|
||||
$upload_system_logs = true;
|
||||
}
|
||||
else if(isset(self::$client_settings['UploadSystemLogsByDefault']))
|
||||
{
|
||||
$upload_system_logs = self::$client_settings['UploadSystemLogsByDefault'];
|
||||
}
|
||||
else if(is_dir($system_log_dir))
|
||||
{
|
||||
$upload_system_logs = pts_user_io::prompt_bool_input('Would you like to attach the system logs (lspci, dmesg, lsusb, etc) to the test result', true, 'UPLOAD_SYSTEM_LOGS');
|
||||
if(pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AlwaysUploadSystemLogs', 'FALSE'))
|
||||
{
|
||||
$upload_system_logs = true;
|
||||
}
|
||||
else if(isset(self::$client_settings['UploadSystemLogsByDefault']))
|
||||
{
|
||||
$upload_system_logs = self::$client_settings['UploadSystemLogsByDefault'];
|
||||
}
|
||||
else if(is_dir($system_log_dir))
|
||||
{
|
||||
$upload_system_logs = pts_user_io::prompt_bool_input('Would you like to attach the system logs (lspci, dmesg, lsusb, etc) to the test result', true, 'UPLOAD_SYSTEM_LOGS');
|
||||
}
|
||||
}
|
||||
|
||||
$system_logs = null;
|
||||
$system_logs_hash = null;
|
||||
if(is_dir($system_log_dir) && $upload_system_logs)
|
||||
if($upload_system_logs)
|
||||
{
|
||||
$is_valid_log = true;
|
||||
$finfo = function_exists('finfo_open') ? finfo_open(FILEINFO_MIME_TYPE) : false;
|
||||
@@ -437,61 +431,6 @@ class pts_openbenchmarking_client
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static function upload_hwsw_data($to_report)
|
||||
{
|
||||
if(!defined('PTS_GSID') || !pts_network::internet_support_available())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach($to_report as $component => &$value)
|
||||
{
|
||||
if(empty($value))
|
||||
{
|
||||
unset($to_report[$component]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$value = $component . '=' . $value;
|
||||
}
|
||||
|
||||
$upload_data = array('report_hwsw' => implode(';', $to_report), 'gsid' => PTS_GSID);
|
||||
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-installed-hardware-software.php', $upload_data);
|
||||
}
|
||||
public static function upload_pci_data($to_report)
|
||||
{
|
||||
if(!defined('PTS_GSID') || !pts_network::internet_support_available())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_array($to_report))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$to_report = base64_encode(serialize($to_report));
|
||||
|
||||
$upload_data = array('report_pci_data' => $to_report, 'gsid' => PTS_GSID);
|
||||
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-pci-data.php', $upload_data);
|
||||
}
|
||||
public static function upload_usb_data($to_report)
|
||||
{
|
||||
if(!defined('PTS_GSID') || !pts_network::internet_support_available())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_array($to_report))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$to_report = base64_encode(serialize($to_report));
|
||||
|
||||
$upload_data = array('report_usb_data' => $to_report, 'gsid' => PTS_GSID);
|
||||
pts_network::http_upload_via_post(pts_openbenchmarking::openbenchmarking_host() . 'extern/statistics/report-usb-data.php', $upload_data);
|
||||
}
|
||||
public static function request_gsid()
|
||||
{
|
||||
if(!pts_network::internet_support_available())
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -49,7 +49,7 @@ class pts_test_execution
|
||||
}
|
||||
|
||||
$lock_file = $test_directory . 'run_lock';
|
||||
if(pts_client::create_lock($lock_file) == false)
|
||||
if(pts_client::create_lock($lock_file) == false && $test_run_manager->is_multi_test_stress_run() == false)
|
||||
{
|
||||
self::test_run_error($test_run_manager, $test_run_request, 'The ' . $test_identifier . ' test is already running.');
|
||||
return false;
|
||||
@@ -101,7 +101,7 @@ class pts_test_execution
|
||||
|
||||
if(!$cache_share_present && $test_run_request->test_profile->is_root_required())
|
||||
{
|
||||
$execute_binary_prepend = PTS_CORE_STATIC_PATH . 'scripts/root-access.sh ';
|
||||
$execute_binary_prepend = PTS_CORE_STATIC_PATH . 'root-access.sh ';
|
||||
}
|
||||
|
||||
if($allow_cache_share && !is_file($cache_share_pt2so))
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2014, Phoronix Media
|
||||
Copyright (C) 2010 - 2014, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -126,7 +126,7 @@ class pts_test_install_request
|
||||
}
|
||||
}
|
||||
|
||||
foreach($test_profile->extended_test_profiles() as $extended_test_profile)
|
||||
foreach($install_request->test_profile->extended_test_profiles() as $extended_test_profile)
|
||||
{
|
||||
if(self::test_files_available_locally($extended_test_profile) == false)
|
||||
{
|
||||
@@ -136,7 +136,37 @@ class pts_test_install_request
|
||||
|
||||
return true;
|
||||
}
|
||||
public function scan_download_caches($local_download_caches, $remote_download_caches, $remote_files, $phoromatic_server_caches)
|
||||
public static function test_files_in_cache(&$test_profile, $include_extended_test_profiles = true, $skip_hash_checks = false)
|
||||
{
|
||||
$install_request = new pts_test_install_request($test_profile);
|
||||
|
||||
$remote_files = false;
|
||||
$local_download_caches = pts_test_install_manager::local_download_caches();
|
||||
$remote_download_caches = false;
|
||||
$phoromatic_server_caches = false;
|
||||
|
||||
$install_request->generate_download_object_list();
|
||||
$install_request->scan_download_caches($local_download_caches, $remote_download_caches, $remote_files, $phoromatic_server_caches, $skip_hash_checks);
|
||||
|
||||
foreach($install_request->get_download_objects() as $download_object)
|
||||
{
|
||||
if($download_object->get_download_location_type() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($install_request->test_profile->extended_test_profiles() as $extended_test_profile)
|
||||
{
|
||||
if(self::test_files_available_locally($extended_test_profile) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public function scan_download_caches($local_download_caches, $remote_download_caches, $remote_files, $phoromatic_server_caches, $skip_hash_checks = false)
|
||||
{
|
||||
$download_location = $this->test_profile->get_install_dir();
|
||||
$main_download_cache = pts_strings::add_trailing_slash(pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
|
||||
@@ -182,7 +212,7 @@ class pts_test_install_request
|
||||
// Scan the local download caches
|
||||
foreach($local_download_caches as &$cache_directory)
|
||||
{
|
||||
if(is_file($cache_directory . $package_filename) && $download_package->check_file_hash($cache_directory . $package_filename))
|
||||
if(is_file($cache_directory . $package_filename) && ($skip_hash_checks || $download_package->check_file_hash($cache_directory . $package_filename)))
|
||||
{
|
||||
if($download_package->get_filesize() == 0)
|
||||
{
|
||||
@@ -212,7 +242,7 @@ class pts_test_install_request
|
||||
{
|
||||
foreach($phoromatic_server_caches as $server_url => $repo)
|
||||
{
|
||||
if(isset($repo[$package_filename]) && ($repo[$package_filename]['md5'] == $download_package->get_md5() || $repo[$package_filename]['sha256'] == $download_package->get_sha256() || ($download_package->get_sha256() == null && $download_package->get_md5() == null)))
|
||||
if(isset($repo[$package_filename]) && ($skip_hash_checks || $repo[$package_filename]['md5'] == $download_package->get_md5() || $repo[$package_filename]['sha256'] == $download_package->get_sha256() || ($download_package->get_sha256() == null && $download_package->get_md5() == null)))
|
||||
{
|
||||
$download_package->set_download_location('REMOTE_DOWNLOAD_CACHE', array($server_url . '/download-cache.php?download=' . $package_filename));
|
||||
break;
|
||||
@@ -227,7 +257,7 @@ class pts_test_install_request
|
||||
{
|
||||
$download_package->set_download_location('REMOTE_DOWNLOAD_CACHE', $remote_files[$package_filename]);
|
||||
}
|
||||
else
|
||||
else if(!empty($remote_download_caches))
|
||||
{
|
||||
// Check for files manually
|
||||
foreach($remote_download_caches as $remote_dir)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2014, Phoronix Media
|
||||
Copyright (C) 2010 - 2014, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -395,7 +395,7 @@ class pts_test_installer
|
||||
}
|
||||
else if(is_file($download_destination_temp) && filesize($download_destination_temp) > 0)
|
||||
{
|
||||
self::test_install_error(null, $test_install_request, 'MD5 Failed: ' . $url);
|
||||
self::test_install_error(null, $test_install_request, 'Checksum Failed: ' . $url);
|
||||
$md5_failed = true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2014, Phoronix Media
|
||||
Copyright (C) 2009 - 2014, Michael Larabel
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -48,6 +48,7 @@ class pts_test_run_manager
|
||||
private $dynamic_run_count_on_length_or_less;
|
||||
private $dynamic_run_count_std_deviation_threshold;
|
||||
private $dynamic_run_count_export_script;
|
||||
private $multi_test_stress_run = false;
|
||||
|
||||
private static $test_run_process_active = false;
|
||||
private static $batch_mode_options = false;
|
||||
@@ -194,7 +195,7 @@ class pts_test_run_manager
|
||||
public function get_test_to_run($index)
|
||||
{
|
||||
$this->last_test_run_index = $index;
|
||||
return isset($this->tests_to_run[$index]) ? $this->tests_to_run[$index] : false;
|
||||
return is_numeric($index) && isset($this->tests_to_run[$index]) ? $this->tests_to_run[$index] : false;
|
||||
}
|
||||
public function get_test_count()
|
||||
{
|
||||
@@ -487,7 +488,7 @@ class pts_test_run_manager
|
||||
pts_client::$display->test_run_process_start($this);
|
||||
|
||||
$total_loop_count = (($t = pts_client::read_env('TOTAL_LOOP_COUNT')) && is_numeric($t) && $t > 0) ? $t : 1;
|
||||
$total_loop_time = (($t = pts_client::read_env('TOTAL_LOOP_TIME')) && is_numeric($t) && $t > 60) ? ($t * 60) : -1;
|
||||
$total_loop_time = (($t = pts_client::read_env('TOTAL_LOOP_TIME')) && is_numeric($t) && $t > 9) ? ($t * 60) : -1;
|
||||
$loop_end_time = $total_loop_time != -1 ? (time() + $total_loop_time) : false;
|
||||
$this->test_run_count = ($tests_to_run_count * $total_loop_count);
|
||||
|
||||
@@ -571,7 +572,7 @@ class pts_test_run_manager
|
||||
{
|
||||
return self::$test_run_process_active = true;
|
||||
}
|
||||
private function process_test_run_request($run_index)
|
||||
public function process_test_run_request($run_index)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
@@ -580,7 +581,15 @@ class pts_test_run_manager
|
||||
$this->result_file_writer->save_xml(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/active.xml');
|
||||
}
|
||||
|
||||
$test_run_request = $this->get_test_to_run($run_index);
|
||||
if(is_object($run_index))
|
||||
{
|
||||
$test_run_request = $run_index;
|
||||
$run_index = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$test_run_request = $this->get_test_to_run($run_index);
|
||||
}
|
||||
|
||||
if(($run_index != 0 && count(pts_file_io::glob($test_run_request->test_profile->get_install_dir() . 'cache-share-*.pt2so')) == 0))
|
||||
{
|
||||
@@ -588,6 +597,11 @@ class pts_test_run_manager
|
||||
sleep(6);
|
||||
}
|
||||
|
||||
if($test_run_request == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pts_test_execution::run_test($this, $test_run_request);
|
||||
|
||||
if(pts_file_io::unlink(PTS_USER_PATH . 'halt-testing'))
|
||||
@@ -715,13 +729,13 @@ class pts_test_run_manager
|
||||
|
||||
return $input;
|
||||
}
|
||||
public static function initial_checks(&$to_run, $test_flags = 0)
|
||||
public static function initial_checks(&$to_run, $test_flags = 0, $override_display_mode = false)
|
||||
{
|
||||
// Refresh the pts_client::$display in case we need to run in debug mode
|
||||
$test_flags |= pts_c::is_run_process;
|
||||
if(pts_client::$display == false || ($test_flags != 0 && !(pts_client::$display instanceof pts_websocket_display_mode)))
|
||||
{
|
||||
pts_client::init_display_mode($test_flags);
|
||||
pts_client::init_display_mode($test_flags, $override_display_mode);
|
||||
}
|
||||
pts_client::set_test_flags($test_flags);
|
||||
$to_run = pts_types::identifiers_to_objects($to_run);
|
||||
@@ -829,10 +843,15 @@ class pts_test_run_manager
|
||||
}
|
||||
|
||||
$mount_options = phodevi::read_property('disk', 'mount-options');
|
||||
if(isset($mount_options['mount-options']) && $mount_options['mount-options'] != null)
|
||||
if($mount_options['mount-options'] != null)
|
||||
{
|
||||
$notes['disk-mount-options'] = $mount_options['mount-options'];
|
||||
}
|
||||
$extra = phodevi::read_property('disk', 'extra-disk-details');
|
||||
if($extra != null)
|
||||
{
|
||||
$notes['disk-details'] = $extra;
|
||||
}
|
||||
}
|
||||
if(true || $show_all || in_array('Processor', $test_hardware_types) || in_array('System', $test_hardware_types))
|
||||
{
|
||||
@@ -1369,6 +1388,118 @@ class pts_test_run_manager
|
||||
// Is there something to run?
|
||||
return $this->get_test_count() > 0;
|
||||
}
|
||||
public function is_multi_test_stress_run()
|
||||
{
|
||||
return $this->multi_test_stress_run;
|
||||
}
|
||||
public function multi_test_stress_run_execute($tests_to_run_concurrently = 3, $total_loop_time = false)
|
||||
{
|
||||
$continue_test_flag = true;
|
||||
pts_client::$display->test_run_process_start($this);
|
||||
$this->disable_dynamic_run_count();
|
||||
$this->multi_test_stress_run = $tests_to_run_concurrently;
|
||||
$possible_tests_to_run = $this->get_tests_to_run();
|
||||
$tests_pids_active = array();
|
||||
$loop_until_time = is_numeric($total_loop_time) && $total_loop_time > 1 ? time() + $total_loop_time : false;
|
||||
|
||||
while(!empty($possible_tests_to_run) || !empty($tests_pids_active))
|
||||
{
|
||||
if($continue_test_flag == false)
|
||||
break;
|
||||
|
||||
$test_types_active = array();
|
||||
foreach($tests_pids_active as $pid => &$test)
|
||||
{
|
||||
$ret = pcntl_waitpid($pid, $status, WNOHANG | WUNTRACED);
|
||||
|
||||
if($ret)
|
||||
{
|
||||
if(pcntl_wifexited($status) || !posix_getsid($pid))
|
||||
{
|
||||
unset($tests_pids_active[$pid]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(!in_array($test->test_profile->get_test_hardware_type(), $test_types_active))
|
||||
{
|
||||
array_push($test_types_active, $test->test_profile->get_test_hardware_type());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!empty($possible_tests_to_run) && count($tests_pids_active) < $tests_to_run_concurrently && (!$total_loop_time || $loop_until_time > time()))
|
||||
{
|
||||
shuffle($possible_tests_to_run);
|
||||
|
||||
$test_to_run = false;
|
||||
$test_run_index = -1;
|
||||
foreach($possible_tests_to_run as $i => $test)
|
||||
{
|
||||
if(!in_array($test->test_profile->get_test_hardware_type(), $test_types_active))
|
||||
{
|
||||
$test_run_index = $i;
|
||||
$test_to_run = $test;
|
||||
}
|
||||
}
|
||||
if($test_run_index == -1)
|
||||
{
|
||||
$test_run_index = array_rand(array_keys($possible_tests_to_run));
|
||||
$test_to_run = $possible_tests_to_run[$test_run_index];
|
||||
}
|
||||
|
||||
$pid = pcntl_fork();
|
||||
if($pid == -1)
|
||||
{
|
||||
echo 'Forking failure.';
|
||||
}
|
||||
else if($pid)
|
||||
{
|
||||
$tests_pids_active[$pid] = $test_to_run;
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_test_flag = $this->process_test_run_request($test_to_run);
|
||||
return false;
|
||||
}
|
||||
|
||||
if($total_loop_time == false)
|
||||
{
|
||||
unset($possible_tests_to_run[$test_run_index]);
|
||||
}
|
||||
else if($total_loop_time == 'infinite')
|
||||
{
|
||||
echo 'Continuing to test indefinitely' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($loop_until_time > time())
|
||||
{
|
||||
$time_left = ceil(($loop_until_time - time()) / 60);
|
||||
echo 'Continuing to test for ' . $time_left . ' more minutes' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'TOTAL_LOOP_TIME elapsed; quitting....' . PHP_EOL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
foreach($this->get_tests_to_run() as $run_request)
|
||||
{
|
||||
// Remove cache shares
|
||||
foreach(pts_file_io::glob($run_request->test_profile->get_install_dir() . 'cache-share-*.pt2so') as $cache_share_file)
|
||||
{
|
||||
unlink($cache_share_file);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
protected function test_prompts_to_result_objects(&$test_profile)
|
||||
{
|
||||
$result_objects = array();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2014, Phoronix Media
|
||||
Copyright (C) 2008 - 2014, Michael Larabel
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
|
||||
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
|
||||
@@ -134,9 +134,12 @@ class pts_tests
|
||||
$extra_vars['LC_CTYPE'] = '';
|
||||
$extra_vars['LC_MESSAGES'] = '';
|
||||
$extra_vars['LANG'] = '';
|
||||
$extra_vars['vblank_mode'] = '0';
|
||||
$extra_vars['PHP_BIN'] = PHP_BIN;
|
||||
|
||||
// Safe-guards to try to ensure more accurate testing
|
||||
$extra_vars['vblank_mode'] = '0'; // Avoid sync to vblank with the open-source drivers
|
||||
$extra_vars['CCACHE_DISABLE'] = '1'; // Should avoid ccache being used in compiler tests
|
||||
|
||||
foreach($test_profile->extended_test_profiles() as $i => $this_test_profile)
|
||||
{
|
||||
if($i == 0)
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2013 - 2014, Phoronix Media
|
||||
Copyright (C) 2013 - 2014, Michael Larabel
|
||||
pts-web-socket_server: Build upon pts_web_socket
|
||||
Copyright (C) 2013 - 2015, Phoronix Media
|
||||
Copyright (C) 2013 - 2015, Michael Larabel
|
||||
pts-web-socket_server_gui: Build upon pts_web_socket with functionality for the web GUI
|
||||
|
||||
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
|
||||
@@ -21,7 +21,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class pts_web_socket_server extends pts_web_socket
|
||||
class pts_web_socket_server_gui extends pts_web_socket
|
||||
{
|
||||
private $sensor_logging = false;
|
||||
private $phodevi_vfs = false;
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2011, Phoronix Media
|
||||
Copyright (C) 2010 - 2011, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
nye_XmlReader.php: The XML reading object for the Phoronix Test Suite succeeding tandem_XmlReader
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -26,6 +26,7 @@ class nye_XmlReader
|
||||
protected $tag_fallback = false; // Fallback value if tag is not present
|
||||
protected $file_location = false;
|
||||
public $dom; // The DOM
|
||||
protected $times_fallback = 0;
|
||||
|
||||
public function __construct($xml_file)
|
||||
{
|
||||
@@ -33,7 +34,7 @@ class nye_XmlReader
|
||||
$this->dom = new DOMDocument();
|
||||
|
||||
// TODO: investigate whether using the LIBXML_COMPACT option on loading actually increases performance
|
||||
if(!isset($xml_file[1024]) && is_file($xml_file))
|
||||
if(!is_object($xml_file) && !isset($xml_file[1024]) && is_file($xml_file))
|
||||
{
|
||||
$this->dom->load($xml_file);
|
||||
$this->file_location = $xml_file;
|
||||
@@ -104,12 +105,21 @@ class nye_XmlReader
|
||||
|
||||
return $values;
|
||||
}
|
||||
public function times_fallback()
|
||||
{
|
||||
return $this->times_fallback;
|
||||
}
|
||||
protected function handleXmlZeroTagFallback($xml_tag, $fallback_value)
|
||||
{
|
||||
if($fallback_value != null)
|
||||
$this->times_fallback++;
|
||||
|
||||
return $fallback_value;
|
||||
}
|
||||
protected function handleXmlZeroTagArrayFallback($xml_tag, $fallback_value, $break_depth = -1)
|
||||
{
|
||||
if($fallback_value != null)
|
||||
$this->times_fallback++;
|
||||
return $fallback_value;
|
||||
}
|
||||
public function getXML()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2014, Phoronix Media
|
||||
Copyright (C) 2010 - 2014, Michael Larabel
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
nye_XmlWriter.php: The XML writing object for the Phoronix Test Suite succeeding tandem_XmlWriter
|
||||
|
||||
Additional Notes: A very simple XML writer with a few extras... Does not support attributes on tags, etc.
|
||||
@@ -29,6 +29,7 @@ class nye_XmlWriter
|
||||
{
|
||||
protected $items;
|
||||
public $dom;
|
||||
protected $times_fallback = 0;
|
||||
|
||||
public function __construct($xsl_binding = null, $nice_formatting = true)
|
||||
{
|
||||
@@ -88,7 +89,20 @@ class nye_XmlWriter
|
||||
public function addXmlNodeFromReader($xml_location, &$xml, $default_value = null)
|
||||
{
|
||||
$value = $xml->getXmlValue($xml_location);
|
||||
$this->addXmlNode($xml_location, (empty($value) ? $default_value : $value));
|
||||
|
||||
if(empty($value))
|
||||
{
|
||||
$value = $default_value;
|
||||
|
||||
if($default_value != null)
|
||||
$this->times_fallback++;
|
||||
}
|
||||
|
||||
$this->addXmlNode($xml_location, $value);
|
||||
}
|
||||
public function times_fallback()
|
||||
{
|
||||
return $this->times_fallback;
|
||||
}
|
||||
public function addXmlNodeFromReaderWNE($xml_location, &$xml)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user