Commit 7e7b3be2 authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Remove old attempt at automating integration tests

parent a35794bb
<?xml version="1.0" encoding="UTF-8"?>
<ezstream>
<server>
<hostname>127.0.0.1</hostname>
<port>34533</port>
<password>ezstream</password>
</server>
<stream>
<mountpoint>/test1.ogg</mountpoint>
<format>Vorbis</format>
</stream>
<media>
<filename>tests.m3u</filename>
<stream_once>Yes</stream_once>
</media>
</ezstream>
<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<source-password>ezstream</source-password>
<relay-password>ezstream</relay-password>
<admin-user>admin</admin-user>
<admin-password>ezstream</admin-password>
</authentication>
<hostname>127.0.0.1</hostname>
<listen-socket>
<port>34533</port>
<bind-address>127.0.0.1</bind-address>
</listen-socket>
<mount>
<mount-name>/usertest.ogg</mount-name>
<username>ezstream</username>
<password>test</password>
</mount>
<fileserve>1</fileserve>
<paths>
<logdir>/tmp</logdir>
<!-- <webroot>/usr/share/icecast2/web</webroot> -->
<!-- <adminroot>/usr/share/icecast2/admin</adminroot> -->
<!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> -->
</paths>
<security>
<chroot>0</chroot>
</security>
</icecast>
#!/usr/bin/env ruby
#
# encoding: UTF-8
MYNAME = File.basename($PROGRAM_NAME, '.rb')
EZSTREAM = '../../src/ezstream'
ICECAST = 'icecast2'
require 'open3'
require 'timeout'
def test_help
STDERR.puts 'test_help'
exit_status = 0
Open3.popen3(EZSTREAM, '-h') do |i, o, e, wait_thr|
exit_status = wait_thr.value.exitstatus
end
fail "exit_status: 0 != #{exit_status}" if exit_status != 0
1
rescue => e
STDERR.puts 'test_help: ' + e.message
0
end
def test_stream
STDERR.puts 'test_stream: http://127.0.0.1:34533/test1.ogg'
exit_status = 0
Open3.popen3(ICECAST, '-c', 'icecast.xml') do |ii, io, ie, icecast|
sleep(2) # icecast needs time to boot
Open3.popen3(EZSTREAM, '-v', '-v', '-v', '-c', 'ezcfg-test1.xml') do |ei, eo, ee, ezstream|
exit_status += ezstream.value.exitstatus
puts ee.read.chomp
end
sleep(1)
Process.kill(15, icecast.pid)
end
fail "exit_status: 0 != #{exit_status}" if exit_status != 0
1
rescue => e
STDERR.puts 'test_stream: ' + e.message
0
end
num_tests = 0
num_passed = 0
num_tests += 1
num_passed += test_help
num_tests += 1
num_passed += test_stream
success_rate = num_passed.to_f.fdiv(num_tests.to_f) * 100
STDERR.puts "#{num_passed}/#{num_tests} passed (#{(success_rate.round)}%)"
exit num_tests == num_passed ? 0 : 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment