diff --git a/Makefile.am b/Makefile.am index aed0bdd4a39d037f25d9e4987b9243750c9a425e..11fccbf362b339e78405b5dab50d090e124cf680 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,20 +4,6 @@ include globals.mak SOURCES= -if BUILD_TEST -TESTS_DIR=test -unittest: - @(cd test; make) - @echo "" - @echo "NOTICE: Unitary tests successfully build" - @echo "Go in the test directory to run them" - @echo "" -else -unittest: - @echo "Ring WARNING:" - @echo " -- You need the cppunit devel package to compile the unitary tests." -endif - ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src ringtones man $(TESTS_DIR) doc bin diff --git a/configure.ac b/configure.ac index 951db4bdef2fbd79d24dd57ccb63cd1c07fd56f0..e85cbd6f3df668decdd0773225c53c35700a77ca 100644 --- a/configure.ac +++ b/configure.ac @@ -638,7 +638,6 @@ AC_CONFIG_FILES([Makefile \ src/media/video/test/Makefile \ src/security/Makefile \ src/upnp/Makefile \ - test/Makefile \ ringtones/Makefile \ man/Makefile \ doc/Makefile \ diff --git a/test/.gitignore b/test/.gitignore deleted file mode 100644 index e600a6bd4dee755048d3c02837aa0dd7ccfcdb7a..0000000000000000000000000000000000000000 --- a/test/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -test -cppunitresults.xml -im:testfile1.txt -im:testfile2.txt diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index 3ccfc38bc6bfa36baf2d51c49ba2ddcd997c4a86..0000000000000000000000000000000000000000 --- a/test/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -include ../globals.mak - -TESTS_ENVIRONMENT = CODECS_PATH="$(top_builddir)/src/audio/codecs" -check_PROGRAMS = test - -TESTS = run_tests.sh - -test_CXXFLAGS = -DWORKSPACE=\"$(top_srcdir)/test/\" @PTHREAD_CFLAGS@ -test_LDADD = $(top_builddir)/src/libring.la \ - $(top_builddir)/src/libring_la-logger.lo \ - @CPPUNIT_LIBS@ @YAMLCPP_LIBS@ @PJPROJECT_LIBS@ - -if BUILD_INSTANT_MESSAGING -test_LDADD += @EXPAT_LIBS@ -endif - -EXTRA_DIST = dring-sample.yml history-sample.tpl tlsSample run_tests.sh -test_SOURCES = constants.h \ - test_utils.h \ - main.cpp \ - accounttest.h \ - accounttest.cpp \ - audiocodectest.h \ - audiocodectest.cpp \ - audiolayertest.h \ - audiolayertest.cpp \ - configurationtest.h \ - configurationtest.cpp \ - historytest.h \ - historytest.cpp \ - numbercleanertest.h \ - numbercleanertest.cpp \ - siptest.h \ - siptest.cpp \ - sdptest.h \ - sdptest.cpp \ - ringbufferpooltest.h \ - ringbufferpooltest.cpp \ - resamplertest.h \ - resamplertest.cpp \ - hooktest.h \ - hooktest.cpp \ - audiobuffertest.h \ - audiobuffertest.cpp \ - iptest.h \ - iptest.cpp - -if BUILD_SDES -test_SOURCES+=sdesnegotiatortest.h \ - sdesnegotiatortest.cpp -endif - -if BUILD_INSTANT_MESSAGING -test_SOURCES+=instantmessagingtest.h \ - instantmessagingtest.cpp -endif - -if BUILD_TLS -test_SOURCES+=tlstest.h \ - tlstest.cpp -endif - -clean-local: - rm -rf cppunitresults.xml im:testfile1.txt im:testfile2.txt \ - sample_echocancel_500ms_8kHz_16bit.raw diff --git a/test/accounttest.cpp b/test/accounttest.cpp deleted file mode 100644 index 06c2096580978681000b823857385b0ab03c75b8..0000000000000000000000000000000000000000 --- a/test/accounttest.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <cppunit/extensions/HelperMacros.h> -#include <map> - -#include "account.h" -#include "account_schema.h" -#include "accounttest.h" -#include "manager.h" -#include "configurationmanager_interface.h" -#include "logger.h" - -namespace ring { namespace test { - -void AccountTest::TestAddRemove() -{ - RING_DBG("-------------------- %s --------------------\n", __PRETTY_FUNCTION__); - - auto details = DRing::getAccountTemplate(); - details[Conf::CONFIG_ACCOUNT_TYPE] = "SIP"; - details[Conf::CONFIG_ACCOUNT_ENABLE] = "false"; - details[Conf::CONFIG_LOCAL_INTERFACE] = "default"; - details[Conf::CONFIG_LOCAL_PORT] = "5060"; - - auto accountId = Manager::instance().addAccount(details); - CPPUNIT_ASSERT(not accountId.empty()); - CPPUNIT_ASSERT(Manager::instance().hasAccount(accountId)); - - Manager::instance().removeAccount(accountId); - CPPUNIT_ASSERT(!Manager::instance().hasAccount(accountId)); -} - -}} // namespace ring::test diff --git a/test/accounttest.h b/test/accounttest.h deleted file mode 100644 index fe6de3ffd040771c23f6e5656b631984e5c29955..0000000000000000000000000000000000000000 --- a/test/accounttest.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef ACCOUNTTEST_H_ -#define ACCOUNTTEST_H_ - -#include <cppunit/TestFixture.h> -#include <cppunit/extensions/HelperMacros.h> - -namespace ring { namespace test { - -class AccountTest : public CppUnit::TestFixture { - - CPPUNIT_TEST_SUITE(AccountTest); - CPPUNIT_TEST(TestAddRemove); - CPPUNIT_TEST_SUITE_END(); - - public: - void TestAddRemove(); -}; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AccountTest, "AccountTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(AccountTest); - -}} // namespace ring::test - -#endif /* ACCOUNTTEST_H_ */ diff --git a/test/audiobuffertest.cpp b/test/audiobuffertest.cpp deleted file mode 100644 index d8ba8dcd085f7fac1ad6558ebda10963e0a617fb..0000000000000000000000000000000000000000 --- a/test/audiobuffertest.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Adrien Beraud <adrienberaud@gmail.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <string> -#include "audiobuffertest.h" -#include "audio/audiobuffer.h" -#include "logger.h" -#include "test_utils.h" - -namespace ring { namespace test { - -void AudioBufferTest::testAudioBufferConstructors() -{ - TITLE(); - - ring::AudioSample test_samples2[] = {10, 11, 12, 13, 14, 15, 16, 17}; - - AudioBuffer empty_buf(0, AudioFormat::MONO()); - CPPUNIT_ASSERT(empty_buf.frames() == 0); - CPPUNIT_ASSERT(empty_buf.channels() == 1); - CPPUNIT_ASSERT(empty_buf.getChannel(0)->size() == 0); - - AudioBuffer test_buf1(8, AudioFormat::STEREO()); - CPPUNIT_ASSERT(test_buf1.frames() == 8); - CPPUNIT_ASSERT(test_buf1.channels() == 2); - CPPUNIT_ASSERT(test_buf1.getChannel(0)->size() == 8); - CPPUNIT_ASSERT(test_buf1.getChannel(1)->size() == 8); - CPPUNIT_ASSERT(test_buf1.getChannel(2) == NULL); - - AudioBuffer test_buf3(test_samples2, 4, AudioFormat::STEREO()); - CPPUNIT_ASSERT(test_buf3.frames() == 4); - CPPUNIT_ASSERT(test_buf3.channels() == 2); - CPPUNIT_ASSERT(test_buf3.getChannel(0)->size() == 4); -} - -void AudioBufferTest::testAudioBufferMix() -{ - TITLE(); - - ring::AudioSample test_samples1[] = {18, 19, 20, 21, 22, 23, 24, 25}; - ring::AudioSample test_samples2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18}; - - AudioBuffer test_buf1(test_samples1, 4, AudioFormat::STEREO()); - CPPUNIT_ASSERT(test_buf1.channels() == 2); - test_buf1.setChannelNum(1); - CPPUNIT_ASSERT(test_buf1.channels() == 1); - test_buf1.setChannelNum(2); - CPPUNIT_ASSERT(test_buf1.channels() == 2); - CPPUNIT_ASSERT(test_buf1.getChannel(1)->size() == 4); - CPPUNIT_ASSERT((*test_buf1.getChannel(1))[0] == 0); - test_buf1.setChannelNum(1); - test_buf1.setChannelNum(2, true); - CPPUNIT_ASSERT((*test_buf1.getChannel(1))[0] == test_samples1[0]); - - AudioBuffer test_buf2(0, AudioFormat::MONO()); - test_buf2.deinterleave(test_samples2, 3, 3); - CPPUNIT_ASSERT((*test_buf2.getChannel(0))[2] == test_samples2[6]); - CPPUNIT_ASSERT((*test_buf2.getChannel(1))[1] == test_samples2[4]); - CPPUNIT_ASSERT((*test_buf2.getChannel(2))[0] == test_samples2[2]); - CPPUNIT_ASSERT(test_buf2.capacity() == 9); - - ring::AudioSample *output = new ring::AudioSample[test_buf2.capacity()]; - test_buf2.interleave(output); - CPPUNIT_ASSERT(std::equal(test_samples2, test_samples2 + sizeof test_samples2 / sizeof *test_samples2, output)); - //CPPUNIT_ASSERT(std::equal(std::begin(test_samples2), std::end(test_samples2), std::begin(output))); C++11 - - test_buf1.mix(test_buf2); - CPPUNIT_ASSERT(test_buf1.channels() == 2); - CPPUNIT_ASSERT(test_buf1.frames() == 4); - CPPUNIT_ASSERT((*test_buf1.getChannel(0))[0] == test_samples1[0]+test_samples2[0]); - CPPUNIT_ASSERT((*test_buf1.getChannel(1))[0] == test_samples1[0]+test_samples2[1]); -} - - -AudioBufferTest::AudioBufferTest() : CppUnit::TestCase("Audio Buffer Tests") {} - -}} // namespace ring::test diff --git a/test/audiobuffertest.h b/test/audiobuffertest.h deleted file mode 100644 index 5661d2f923f3f0f763ec6e6e23db2408ba2d0317..0000000000000000000000000000000000000000 --- a/test/audiobuffertest.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Adrien Beraud <adrienberaud@gmail.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef AUDIOBUFFER_TEST_ -#define AUDIOBUFFER_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -/* - * @file audiobuffertest.cpp - * @brief Regroups unit tests related to an audio buffer. - */ - -namespace ring { namespace test { - -class AudioBufferTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(AudioBufferTest); - CPPUNIT_TEST(testAudioBufferConstructors); - CPPUNIT_TEST(testAudioBufferMix); - CPPUNIT_TEST_SUITE_END(); - - public: - - AudioBufferTest(); - - void testAudioBufferConstructors(); - - void testAudioBufferMix(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AudioBufferTest, "AudioBufferTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(AudioBufferTest); - -}} // namespace ring::test - -#endif // AUDIOBUFFER_TEST_ diff --git a/test/audiocodectest.cpp b/test/audiocodectest.cpp deleted file mode 100644 index 9fbfa790617b098db4609272247abff002798e94..0000000000000000000000000000000000000000 --- a/test/audiocodectest.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * ebail - 2015/02/18 - * testCodecs unit test is based on audiocodecfactory - * we are not using it anymore - * we should make this unit test work with libav - * this test is disabled for the moment - * */ -#if 0 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "audiocodectest.h" -#include "audio/codecs/audiocodecfactory.h" -#include "plugin_manager.h" - -#include "test_utils.h" -#include "ring_types.h" // for AudioSample - -#include <cmath> -#include <climits> - -namespace ring { namespace test { - - -/* - * Detect the power of a signal for a given frequency. - * Adapted from: - * http://netwerkt.wordpress.com/2011/08/25/goertzel-filter/ - */ -static double -goertzelFilter(AudioSample *samples, double freq, unsigned N, double sample_rate) -{ - double s_prev = 0.0; - double s_prev2 = 0.0; - const double normalizedfreq = freq / sample_rate; - double coeff = 2 * cos(M_2_PI * normalizedfreq); - for (unsigned i = 0; i < N; i++) { - double s = samples[i] + coeff * s_prev - s_prev2; - s_prev2 = s_prev; - s_prev = s; - } - - return s_prev2 * s_prev2 + s_prev * s_prev - coeff * s_prev * s_prev2; -} - -void AudioCodecTest::testCodecs() -{ - TITLE(); - - PluginManager pluginMgr; - AudioCodecFactory factory(pluginMgr); - const auto payloadTypes = factory.getCodecList(); - - std::vector<std::shared_ptr<AudioCodec>> codecs; - - for (auto p : payloadTypes) - codecs.push_back(factory.getCodec(p)); - - std::vector<std::vector<AudioSample>> sine = {}; - std::vector<std::vector<AudioSample>> pcm; - - unsigned sampleRate = 0; - double referencePower = 0.0; - - for (auto c : codecs) { - - // generate the sine tone if rate has changed - if (sampleRate != c->getCurrentClockRate()) { - sampleRate = c->getCurrentClockRate(); - const unsigned nbSamples = sampleRate * 0.02; // 20 ms worth of samples - sine = {std::vector<AudioSample>(nbSamples)}; - pcm = {std::vector<AudioSample>(nbSamples)}; - - const float theta = M_2_PI * frequency_ / sampleRate; - - for (unsigned i = 0; i < nbSamples; ++i) { - sine[0][i] = SHRT_MAX * sin(theta * i); - sine[0][i] >>= 3; /* attenuate it a bit */ - } - - /* Store the raw signal's power detected at 440 Hz, this is much cheaper - * than an FFT */ - referencePower = goertzelFilter(sine[0].data(), frequency_, sine[0].size(), sampleRate); - } - - std::vector<uint8_t> data(RAW_BUFFER_SIZE); - - const size_t encodedBytes = c->encode(sine, data.data(), sine[0].size()); - - unsigned decoded = c->decode(pcm, data.data(), encodedBytes); - CPPUNIT_ASSERT(decoded == sine[0].size()); - - const auto decodedPower = goertzelFilter(pcm[0].data(), frequency_, pcm[0].size(), sampleRate); - const auto decodedRatio = decodedPower / referencePower; - CPPUNIT_ASSERT(decodedRatio > 0.0); - } -} - -}} // namespace ring::test -#endif diff --git a/test/audiocodectest.h b/test/audiocodectest.h deleted file mode 100644 index 9baae40b5ae8f2a65eac3a5124e1bc76233c60e2..0000000000000000000000000000000000000000 --- a/test/audiocodectest.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * @file audiocodectest.h - * @brief For every available audio codec, encode a buffer, decode it, - * and analyze the signal to ensure that it's similar to what was - * encoded. - */ - -#ifndef AUDIO_CODEC_TEST_ -#define AUDIO_CODEC_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -namespace ring { namespace test { - -class AudioCodecTest: public CppUnit::TestFixture { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(AudioCodecTest); - /* - * ebail - 2015/02/18 - * testCodecs unit test is based on audiocodecfactory - * we are not using it anymore - * we should make this unit test work with libav - * this test is disabled for the moment - * */ - //CPPUNIT_TEST(testCodecs); - CPPUNIT_TEST_SUITE_END(); - - static const short frequency_ = 440; - - public: - void testCodecs(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AudioCodecTest, "AudioCodecTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(AudioCodecTest); - -}} // namespace ring::test - -#endif // AUDIO_CODEC_TEST_ diff --git a/test/audiolayertest.cpp b/test/audiolayertest.cpp deleted file mode 100644 index eac4a97f9db5c54abaadf4d81d669df7981f7ac4..0000000000000000000000000000000000000000 --- a/test/audiolayertest.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "audiolayertest.h" - -#include "logger.h" -#include "manager.h" -#include "audio/alsa/alsalayer.h" -#include "audio/pulseaudio/pulselayer.h" -#include "test_utils.h" -#include <unistd.h> - -namespace ring { namespace test { - -AudioLayerTest::AudioLayerTest() : manager_(0), pulselayer_(0), layer_(0) -{} - -void AudioLayerTest::testAudioLayerConfig() -{ - TITLE(); - - CPPUNIT_ASSERT(Manager::instance().audioPreference.getAlsaSmplrate() == 44100); - - // alsa preferences - CPPUNIT_ASSERT(Manager::instance().audioPreference.getAlsaCardin() == 0); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getAlsaCardout() == 0); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getAlsaCardring() == 0); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getAlsaPlugin() == "default"); - - // pulseaudio preferences - CPPUNIT_ASSERT(Manager::instance().audioPreference.getPulseDevicePlayback() == "alsa_output.pci-0000_00_1b.0.analog-stereo"); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getPulseDeviceRecord() == "alsa_input.pci-0000_00_1b.0.analog-stereo"); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getPulseDeviceRingtone() == "alsa_output.pci-0000_00_1b.0.analog-stereo"); - - CPPUNIT_ASSERT(Manager::instance().audioPreference.getVolumemic() == 1.0); - CPPUNIT_ASSERT(Manager::instance().audioPreference.getVolumespkr() == 1.0); - - // TODO: Fix tests - //CPPUNIT_ASSERT ( (int) Manager::instance().getAudioDriver()->getSampleRate() == sampling_rate); -} - -void AudioLayerTest::testAudioLayerSwitch() -{ - TITLE(); - - bool wasAlsa = dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver().get()) != 0; - - for (int i = 0; i < 2; i++) { - RING_DBG("iter - %i", i); - if (wasAlsa) - Manager::instance().setAudioManager(PULSEAUDIO_API_STR); - else - Manager::instance().setAudioManager(ALSA_API_STR); - - if (wasAlsa) - CPPUNIT_ASSERT(dynamic_cast<PulseLayer*>(Manager::instance().getAudioDriver().get())); - else - CPPUNIT_ASSERT(dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver().get())); - - wasAlsa = dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver().get()) != 0; - const struct timespec req = {0, 100000000}; - nanosleep(&req, 0); - } -} - -void AudioLayerTest::testPulseConnect() -{ - TITLE(); - - if (dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver().get())) { - Manager::instance().setAudioManager(PULSEAUDIO_API_STR); - const struct timespec req = {0, 100000000}; - nanosleep(&req, 0); - } - - pulselayer_ = dynamic_cast<PulseLayer*>(Manager::instance().getAudioDriver().get()); - - CPPUNIT_ASSERT(pulselayer_); -} - -}} // namespace ring::test diff --git a/test/audiolayertest.h b/test/audiolayertest.h deleted file mode 100644 index 9fff17549b44821813d589aefc6db2dae74b1a42..0000000000000000000000000000000000000000 --- a/test/audiolayertest.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * @file audiorecorderTest.cpp - * @brief Regroups unitary tests related to the plugin manager. - */ - -#ifndef AUDIOLAYER_TEST_ -#define AUDIOLAYER_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include "noncopyable.h" - -namespace ring { - -class Manager; -class PulseLayer; - -} // namespace ring - -namespace ring { namespace test { - -class AudioLayerTest: public CppUnit::TestFixture { - - CPPUNIT_TEST_SUITE(AudioLayerTest); - CPPUNIT_TEST(testAudioLayerConfig); - //CPPUNIT_TEST(testPulseConnect); - //TODO: this test ends the test sequence when using on a alsa only system - //CPPUNIT_TEST(testAudioLayerSwitch); - CPPUNIT_TEST_SUITE_END(); - - public: - AudioLayerTest(); - void testAudioLayerConfig(); - void testPulseConnect(); - void testAudioLayerSwitch(); - - private: - NON_COPYABLE(AudioLayerTest); - - Manager* manager_; - PulseLayer* pulselayer_; - int layer_; -}; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AudioLayerTest, "AudioLayerTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(AudioLayerTest); - -}} // namespace ring::test - -#endif // AUDIOLAYER_TEST_ diff --git a/test/configurationtest.cpp b/test/configurationtest.cpp deleted file mode 100644 index b0e4865ea741baf325c32623dc77e97cef419547..0000000000000000000000000000000000000000 --- a/test/configurationtest.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "configurationtest.h" -#include "fileutils.h" -#include "config/yamlparser.h" - -namespace ring { namespace test { - -void ConfigurationTest::testNodeParse() -{ - YAML::Node node = YAML::Load("[{a: 0, b: 1, c: 2}, {a: 0, b: 1, c: 2}]"); - auto result = yaml_utils::parseVectorMap(node, {"a", "b", "c"}); - CPPUNIT_ASSERT(result[1]["b"] == "1"); -} - -void ConfigurationTest::test_expand_path(void){ - const std::string pattern_1 = "~"; - const std::string pattern_2 = "~/x"; - const std::string pattern_3 = "~foo/x"; // deliberately broken, - // tilde should not be expanded - std::string home = fileutils::get_home_dir(); - - CPPUNIT_ASSERT(fileutils::expand_path(pattern_1) == home); - CPPUNIT_ASSERT(fileutils::expand_path(pattern_2) == home.append("/x")); - CPPUNIT_ASSERT(fileutils::expand_path(pattern_3) == "~foo/x"); -} - -}} // namespace ring::test diff --git a/test/configurationtest.h b/test/configurationtest.h deleted file mode 100644 index 4d8f1170449d74f41731098f0b04b26081d934d8..0000000000000000000000000000000000000000 --- a/test/configurationtest.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * @file configurationTest.cpp - * @brief Regroups unitary tests related to the user configuration. - * Check if the default configuration has been successfully loaded - */ - -#ifndef CONFIGURATION_TEST_ -#define CONFIGURATION_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -namespace ring { namespace test { - -class ConfigurationTest: public CppUnit::TestFixture { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(ConfigurationTest); - CPPUNIT_TEST(testNodeParse); - CPPUNIT_TEST(test_expand_path); - CPPUNIT_TEST_SUITE_END(); - - public: - - void testNodeParse(); - void test_expand_path(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ConfigurationTest, "ConfigurationTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(ConfigurationTest); - -}} // namespace ring::test - -#endif // CONFIGURATION_TEST_ diff --git a/test/constants.h b/test/constants.h deleted file mode 100644 index 020cad47ae08532de3892be98feca88dc0f5c11e..0000000000000000000000000000000000000000 --- a/test/constants.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef CONSTANTS_H_ -#define CONSTANTS_H_ - -#define HISTORY_SAMPLE WORKSPACE "history-sample.tpl" -#define HISTORY_SAMPLE_BAK HISTORY_SAMPLE ".bak" - -#define CONFIG_SAMPLE WORKSPACE "dring-sample.yml" -#define CONFIG_SAMPLE_BAK CONFIG_SAMPLE ".bak" - -#define HISTORY_SAMPLE_SIZE 3 -#define HISTORY_LIMIT 30 - -#endif /* CONSTANTS_H_ */ diff --git a/test/dring-sample.yml b/test/dring-sample.yml deleted file mode 100644 index 67832297bf4246bd4fb8783e4dfe0a14215fa6c1..0000000000000000000000000000000000000000 --- a/test/dring-sample.yml +++ /dev/null @@ -1,199 +0,0 @@ ---- -accounts: -- alias: SFL test - audioCodecs: 0/3/8/9/110/111/112/ - autoAnswer: false - credential: - - Account.password: 1234 - Account.realm: - Account.username: sfltest - displayName: - dtmfType: overrtp - enable: false - hasCustomUserAgent: true - hostname: localhost - id: Account:1334389473 - interface: default - keepAlive: false - mailbox: - port: 5060 - publishAddr: 0.0.0.0 - publishPort: 5060 - registrationexpire: 600 - ringtoneEnabled: true - ringtonePath: /usr/share/ring/ringtones/default.wav - sameasLocal: true - serviceRoute: - srtp: - enable: false - keyExchange: - rtpFallback: false - stunEnabled: false - stunServer: - tls: - calist: - certificate: - ciphers: - enable: false - method: TLSv1 - password: - privateKey: - requireCertif: true - server: - timeout: 2 - tlsPort: 5061 - verifyClient: true - verifyServer: true - type: SIP - useragent: SFLphone-test - username: sfltest - videoCodecs: - - bitrate: 400 - enabled: true - name: H263-2000 - parameters: - - bitrate: 400 - enabled: true - name: H264 - parameters: profile-level-id=428014 - - bitrate: 400 - enabled: true - name: MP4V-ES - parameters: - - bitrate: 400 - enabled: true - name: VP8 - parameters: - videoEnabled: true - videoPortMax: 65534 - videoPortMin: 49152 - zrtp: - displaySas: true - displaySasOnce: false - helloHashEnabled: true - notSuppWarning: true -- alias: IP2IP - audioCodecs: 0/3/8/9/110/111/112/ - autoAnswer: false - credential: - - Account.password: - Account.realm: - Account.username: - displayName: - dtmfType: true - enable: true - hasCustomUserAgent: true - hostname: - id: IP2IP - interface: default - keepAlive: false - mailbox: - port: 5060 - publishAddr: - publishPort: 5060 - registrationexpire: 60 - ringtoneEnabled: true - ringtonePath: /usr/share/ring/ringtones/default.wav - sameasLocal: true - serviceRoute: - srtp: - enable: false - keyExchange: sdes - rtpFallback: false - stunEnabled: false - stunServer: - tls: - calist: - certificate: - ciphers: - enable: false - method: TLSv1 - password: - privateKey: - requireCertif: true - server: - timeout: 2 - tlsPort: 5061 - verifyClient: true - verifyServer: true - type: SIP - useragent: SFLphone-test - username: - videoCodecs: - - bitrate: 400 - enabled: true - name: H263-2000 - parameters: - - bitrate: 400 - enabled: true - name: H264 - parameters: profile-level-id=428014 - - bitrate: 400 - enabled: true - name: MP4V-ES - parameters: - - bitrate: 400 - enabled: true - name: VP8 - parameters: - videoEnabled: true - videoPortMax: 65534 - videoPortMin: 49152 - zrtp: - displaySas: true - displaySasOnce: false - helloHashEnabled: true - notSuppWarning: true -preferences: - historyLimit: 30 - historyMaxCalls: 20 - md5Hash: false - order: Account:1375906657/Account:1328115463/Account:1328115393/Account:1328115062/Account:1316122317/Account:1316122284/Account:1316121900/Account:1316121889/Account:1316121691/Account:1316121662/Account:1316121661/Account:1316121654/Account:1316121611/Account:1316121607/Account:1316121605/Account:1316121602/Account:1312584532/Account:1312398082/Account:1312398066/Account:1309188361/Account:1309187807/Account:1309187723/Account:1309187670/Account:1309187609/Account:1309187081/Account:1308839853/Account:1308839662/Account:1308839447/Account:1308839359/Account:1308839335/Account:1308838875/Account:1308838713/Account:1308838236/Account:1307975440/Account:1307975347/Account:1307974800/Account:1307974672/Account:1307974527/Account:1303487773/Account:1303247743/Account:1302895321/Account:1302892836/Account:1302891834/Account:1302882519/Account:1302207377/Account:1302207262/Account:1302204136/Account:1302204108/Account:1294850905/Account:1294850775/Account:1294850618/Account:1294849651/Account:1294849602/Account:1294849310/Account:1288964768/Account:1288964603/Account:1288964434/Account:1288964141/Account:1288964134/ - portNum: 5060 - registrationexpire: 180 - searchBarDisplay: true - zoneToneChoice: North America -voipPreferences: - playDtmf: true - playTones: true - pulseLength: 250 - symmetric: true - zidFile: true -hooks: - iax2Enabled: false - numberAddPrefix: - numberEnabled: false - sipEnabled: false - urlCommand: x-www-browser - urlSipField: X-sflphone-url -audio: - alsa: - cardIn: 0 - cardOut: 0 - cardRing: 0 - plugin: default - smplRate: 44100 - alwaysRecording: false - audioApi: pulseaudio - echoCancel: false - noiseReduce: true - pulse: - devicePlayback: alsa_output.pci-0000_00_1b.0.analog-stereo - deviceRecord: alsa_input.pci-0000_00_1b.0.analog-stereo - deviceRingtone: alsa_output.pci-0000_00_1b.0.analog-stereo - recordPath: ~ - volumeMic: 1.0 - volumeSpkr: 1.0 -video: - devices: - - channel: Camera 1 - name: Integrated Camera - rate: 30 - size: 640x480 -shortcuts: - hangUp: - pickUp: - popupWindow: - toggleHold: - togglePickupHangup: -... diff --git a/test/history-sample.tpl b/test/history-sample.tpl deleted file mode 100644 index ec7fcdf0dc2e2168848ccf24283329184c4f3103..0000000000000000000000000000000000000000 --- a/test/history-sample.tpl +++ /dev/null @@ -1,30 +0,0 @@ -accountid= -confid= -callid=Account:1239059899 -peer_name=Emmanuel Milou -peer_number=136 -recordfile= -timestamp_start=747638685 -timestamp_stop=747638765 -state=outgoing - -accountid=empty -confid= -callid= -peer_name=Savoir-faire Linux -peer_number=514-276-5468 -recordfile= -timestamp_start=144562000 -timestamp_stop=144562458 -state=missed - -accountid= -confid= -callid=Account:43789459478 -peer_name= -peer_number=5143848557 -recordfile= -timestamp_start=775354456 -timestamp_stop=775354987 -state=incoming - diff --git a/test/historytest.cpp b/test/historytest.cpp deleted file mode 100644 index e38852939788e082b79972e1ad086ae679ec1c25..0000000000000000000000000000000000000000 --- a/test/historytest.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <cstdlib> - -#include "historytest.h" -#include "history/history.h" -#include "logger.h" -#include "constants.h" - -namespace ring { namespace test { - -namespace { -void restore() -{ - if (system("mv " HISTORY_SAMPLE_BAK " " HISTORY_SAMPLE) < 0) - RING_ERR("Restoration of %s failed", HISTORY_SAMPLE); -} - -void backup() -{ - if (system("cp " HISTORY_SAMPLE " " HISTORY_SAMPLE_BAK) < 0) - RING_ERR("Backup of %s failed", HISTORY_SAMPLE); -} -} - -void HistoryTest::setUp() -{ - backup(); - history_ = new History; - history_->setPath(HISTORY_SAMPLE); -} - - -void HistoryTest::test_create_path() -{ - RING_DBG("-------------------- HistoryTest::test_set_path --------------------\n"); - - std::string path(HISTORY_SAMPLE); - CPPUNIT_ASSERT(history_->path_ == path); -} - -void HistoryTest::test_load_from_file() -{ - RING_DBG("-------------------- HistoryTest::test_load_from_file --------------------\n"); - - bool res = history_->load(HISTORY_LIMIT); - CPPUNIT_ASSERT(res); -} - -void HistoryTest::test_load_items() -{ - RING_DBG("-------------------- HistoryTest::test_load_items --------------------\n"); - bool res = history_->load(HISTORY_LIMIT); - CPPUNIT_ASSERT(res); - CPPUNIT_ASSERT(history_->numberOfItems() == HISTORY_SAMPLE_SIZE); -} - -void HistoryTest::test_save_to_file() -{ - RING_DBG("-------------------- HistoryTest::test_save_to_file --------------------\n"); - CPPUNIT_ASSERT(history_->save()); -} - -void HistoryTest::test_get_serialized() -{ - RING_DBG("-------------------- HistoryTest::test_get_serialized --------------------\n"); - bool res = history_->load(HISTORY_LIMIT); - CPPUNIT_ASSERT(res); - CPPUNIT_ASSERT(history_->getSerialized().size() == HISTORY_SAMPLE_SIZE); -} - -void HistoryTest::tearDown() -{ - delete history_; - restore(); -} - -}} // namespace ring::test diff --git a/test/historytest.h b/test/historytest.h deleted file mode 100644 index 7b270d3caff9337e8eec98cb810f3eff5e8c935d..0000000000000000000000000000000000000000 --- a/test/historytest.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -// Application import -#include "noncopyable.h" - -/* - * @file historyTest.h - * @brief Regroups unitary tests related to the phone number cleanup function. - */ - -#ifndef HISTORY_TEST_ -#define HISTORY_TEST_ - -namespace ring { -class History; -} // namespace ring - -namespace ring { namespace test { - -class HistoryTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(HistoryTest); - CPPUNIT_TEST(test_create_path); - CPPUNIT_TEST(test_load_from_file); - CPPUNIT_TEST(test_load_items); - CPPUNIT_TEST(test_get_serialized); - CPPUNIT_TEST_SUITE_END(); - - public: - HistoryTest() : CppUnit::TestCase("History Tests"), history_(0) {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - void test_create_path(); - - void test_load_from_file(); - - void test_load_items(); - - void test_save_to_file(); - - void test_get_serialized(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - void tearDown(); - - private: - NON_COPYABLE(HistoryTest); - ring::History *history_; -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(HistoryTest, "HistoryTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(HistoryTest); - - -}} // namespace ring::test - -#endif // HISTORY_TEST_ diff --git a/test/hooktest.cpp b/test/hooktest.cpp deleted file mode 100644 index e57ce63716050baa7d5d5ba77dc40a65080bde8f..0000000000000000000000000000000000000000 --- a/test/hooktest.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "hooktest.h" -#include "hooks/urlhook.h" - -namespace ring { namespace test { - -void HookTest::RunHookWithNoArgs() -{ - CPPUNIT_ASSERT(!UrlHook::runAction("ls", "")); -} - -void HookTest::RunHookWithArgs() -{ - CPPUNIT_ASSERT(!UrlHook::runAction("ls", "-l")); -} - -}} // namespace ring::test diff --git a/test/hooktest.h b/test/hooktest.h deleted file mode 100644 index b021c01659f96b2f0b0479860f2ee4a738eb2d15..0000000000000000000000000000000000000000 --- a/test/hooktest.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013-2016 Savoir-faire Linux Inc. - * - * Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef HOOKTEST_H_ -#define HOOKTEST_H_ - -#include <cppunit/TestFixture.h> -#include <cppunit/extensions/HelperMacros.h> - -namespace ring { namespace test { - -class HookTest : public CppUnit::TestFixture { - - CPPUNIT_TEST_SUITE(HookTest); - CPPUNIT_TEST(RunHookWithNoArgs); - CPPUNIT_TEST(RunHookWithArgs); - CPPUNIT_TEST_SUITE_END(); - - public: - void RunHookWithNoArgs(); - void RunHookWithArgs(); -}; - -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(HookTest, "HookTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(HookTest); - -}} // namespace ring::test - -#endif /* HOOKTEST_H_ */ diff --git a/test/instantmessagingtest.cpp b/test/instantmessagingtest.cpp deleted file mode 100644 index 3a6158f00bc9e902153b3e4ea46c24d2870d38e2..0000000000000000000000000000000000000000 --- a/test/instantmessagingtest.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <iostream> -#include <fstream> -#include <expat.h> -#include "test_utils.h" - -#include "instantmessagingtest.h" -#include "im/instant_messaging.h" -#include "logger.h" - -#define MAXIMUM_SIZE 10 -#define DELIMITER_CHAR "\n\n" - -namespace ring { namespace InstantMessaging { namespace test { - -void InstantMessagingTest::testSaveSingleMessage() -{ - TITLE(); - std::string callID = "testfile1.txt"; - std::string filename = "im:"; - - // Open a file stream and try to write in it - CPPUNIT_ASSERT(saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out)); - - filename.append(callID); - // Read it to check it has been successfully written - std::ifstream testfile(filename.c_str(), std::ios::in); - CPPUNIT_ASSERT(testfile.is_open()); - - std::string input; - while (!testfile.eof()) { - std::string tmp; - std::getline(testfile, tmp); - input.append(tmp); - } - - testfile.close(); - CPPUNIT_ASSERT(input == "[Manu] Bonjour, c'est un test d'archivage de message"); -} - -void InstantMessagingTest::testSaveMultipleMessage() -{ - TITLE(); - - std::string callID = "testfile2.txt"; - std::string filename = "im:"; - - // Open a file stream and try to write in it - CPPUNIT_ASSERT(saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out)); - CPPUNIT_ASSERT(saveMessage("Cool", "Alex", callID, std::ios::out || std::ios::app)); - - filename.append(callID); - // Read it to check it has been successfully written - std::ifstream testfile(filename.c_str(), std::ios::in); - CPPUNIT_ASSERT(testfile.is_open()); - - std::string input; - while (!testfile.eof()) { - std::string tmp; - std::getline(testfile, tmp); - input.append(tmp); - } - - testfile.close(); - printf("%s\n", input.c_str()); - CPPUNIT_ASSERT(input == "[Manu] Bonjour, c'est un test d'archivage de message[Alex] Cool"); -} - -static inline char* duplicateString(char dst[], const char src[], size_t len) -{ - memcpy(dst, src, len); - dst[len] = 0; - return dst; -} - -static void XMLCALL startElementCallback(void *userData, const char *name, const char **atts) -{ - - std::cout << "startElement " << name << std::endl; - - int *nbEntry = (int *) userData; - - char attribute[50]; - char value[50]; - - for (const char **att = atts; *att; att += 2) { - - const char **val = att+1; - - duplicateString(attribute, *att, strlen(*att)); - std::cout << "att: " << attribute << std::endl; - - duplicateString(value, *val, strlen(*val)); - std::cout << "val: " << value << std::endl; - - if (strcmp(attribute, "uri") == 0) { - if ((strcmp(value, "sip:alex@example.com") == 0) || - (strcmp(value, "sip:manu@example.com") == 0)) - CPPUNIT_ASSERT(true); - else - CPPUNIT_ASSERT(false); - } - } - - *nbEntry += 1; -} - -static void XMLCALL -endElementCallback(void * /*userData*/, const char * /*name*/) -{} - -void InstantMessagingTest::testGenerateXmlUriList() -{ - std::cout << std::endl; - - // Create a test list with two entries - UriList list; - - UriEntry entry1; - entry1[IM_XML_URI] = "\"sip:alex@example.com\""; - - UriEntry entry2; - entry2[IM_XML_URI] = "\"sip:manu@example.com\""; - - list.push_front(entry1); - list.push_front(entry2); - - std::string buffer = generateXmlUriList(list); - CPPUNIT_ASSERT(buffer.size() != 0); - - std::cout << buffer << std::endl; - - // parse the resuling xml (further tests are performed in callbacks) - XML_Parser parser = XML_ParserCreate(NULL); - int nbEntry = 0; - XML_SetUserData(parser, &nbEntry); - XML_SetElementHandler(parser, startElementCallback, endElementCallback); - - if (XML_Parse(parser, buffer.c_str(), buffer.size(), 1) == XML_STATUS_ERROR) { - RING_ERR("%s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser)); - CPPUNIT_ASSERT(false); - } - - XML_ParserFree(parser); - CPPUNIT_ASSERT(nbEntry == 4); -} - -void InstantMessagingTest::testXmlUriListParsing() -{ - std::string xmlbuffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; - xmlbuffer.append("<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\">"); - xmlbuffer.append("<list>"); - xmlbuffer.append("<entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" />"); - xmlbuffer.append("<entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" />"); - xmlbuffer.append("</list>"); - xmlbuffer.append("</resource-lists>"); - - - UriList list = parseXmlUriList(xmlbuffer); - CPPUNIT_ASSERT(list.size() == 2); - - // An iterator over xml attribute - UriEntry::iterator iterAttr; - - // An iterator over list entries - for (auto &entry : list) { - iterAttr = entry.find(IM_XML_URI); - - CPPUNIT_ASSERT((iterAttr->second == std::string("sip:alex@example.com")) or - (iterAttr->second == std::string("sip:manu@example.com"))); - } -} - -void InstantMessagingTest::testGetTextArea() -{ - - std::string formatedText = "--boundary Content-Type: text/plain"; - formatedText.append("Here is the text area"); - - formatedText.append("--boundary Content-Type: application/resource-lists+xml"); - formatedText.append("Content-Disposition: recipient-list"); - formatedText.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - formatedText.append("<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\">"); - formatedText.append("<list>"); - formatedText.append("<entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("<entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("</list>"); - formatedText.append("</resource-lists>"); - formatedText.append("--boundary--"); - - std::string message(findTextMessage(formatedText)); - RING_DBG("Message %s", message.c_str()); - - CPPUNIT_ASSERT(message == "Here is the text area"); -} - -void InstantMessagingTest::testGetUriListArea() -{ - std::string formatedText = "--boundary Content-Type: text/plain"; - formatedText.append("Here is the text area"); - - formatedText.append("--boundary Content-Type: application/resource-lists+xml"); - formatedText.append("Content-Disposition: recipient-list"); - formatedText.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - formatedText.append("<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\">"); - formatedText.append("<list>"); - formatedText.append("<entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("<entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("</list>"); - formatedText.append("</resource-lists>"); - formatedText.append("--boundary--"); - - std::string urilist = findTextUriList(formatedText); - - CPPUNIT_ASSERT(urilist.compare("<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\"><list><entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" /><entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" /></list></resource-lists>") == 0); - - std::cout << "urilist: " << urilist << std::endl; - - UriList list = parseXmlUriList(urilist); - CPPUNIT_ASSERT(list.size() == 2); - - // order may be important, for example to identify message sender - UriEntry entry = list.front(); - CPPUNIT_ASSERT(entry.size() == 2); - - UriEntry::iterator iterAttr = entry.find(IM_XML_URI); - - if (iterAttr == entry.end()) { - RING_ERR("Did not find attribute"); - CPPUNIT_ASSERT(false); - } - - std::string from = iterAttr->second; - CPPUNIT_ASSERT(from == "sip:alex@example.com"); -} - -void InstantMessagingTest::testIllFormatedMessage() -{ - bool exceptionCaught = false; - - // SHOULD BE: Content-Type: text/plain - std::string formatedText = "--boundary Content-Ty"; - formatedText.append("Here is the text area"); - - formatedText.append("--boundary Content-Type: application/resource-lists+xml"); - formatedText.append("Content-Disposition: recipient-list"); - formatedText.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - formatedText.append("<resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\">"); - formatedText.append("<list>"); - formatedText.append("<entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("<entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" />"); - formatedText.append("</list>"); - formatedText.append("</resource-lists>"); - formatedText.append("--boundary--"); - - try { - std::string message = findTextMessage(formatedText); - } catch (const InstantMessageException &e) { - exceptionCaught = true; - } - - CPPUNIT_ASSERT(exceptionCaught); -} - -}}} // namespace ring::InstantMessaging::test diff --git a/test/instantmessagingtest.h b/test/instantmessagingtest.h deleted file mode 100644 index b9a25601766d342e44f8ba9a8fa6f195308ddd84..0000000000000000000000000000000000000000 --- a/test/instantmessagingtest.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -/* - * @file instantmessagingtest.h - * @brief Unit tests related to the instant messaging module - */ - -#ifndef INSTANTMANAGER_TEST_ -#define INSTANTMANAGER_TEST_ - -namespace ring { namespace InstantMessaging { namespace test { - -class InstantMessagingTest : public CppUnit::TestCase { - CPPUNIT_TEST_SUITE(InstantMessagingTest); - CPPUNIT_TEST(testSaveSingleMessage); - CPPUNIT_TEST(testSaveMultipleMessage); - CPPUNIT_TEST(testGenerateXmlUriList); - CPPUNIT_TEST(testXmlUriListParsing); - CPPUNIT_TEST(testGetTextArea); - CPPUNIT_TEST(testGetUriListArea); - CPPUNIT_TEST(testIllFormatedMessage); - CPPUNIT_TEST_SUITE_END(); - - public: - InstantMessagingTest() : CppUnit::TestCase("Instant messaging module Tests") {} - - void testSaveSingleMessage(); - void testSaveMultipleMessage(); - void testGenerateXmlUriList(); - void testXmlUriListParsing(); - void testGetTextArea(); - void testGetUriListArea(); - void testIllFormatedMessage(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(InstantMessagingTest, "InstantMessagingTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(InstantMessagingTest); - -}}} // namespace ring::InstantMessaging::test - -#endif diff --git a/test/iptest.cpp b/test/iptest.cpp deleted file mode 100644 index 92c1273bd2214f95bac920d574524a6964501a7c..0000000000000000000000000000000000000000 --- a/test/iptest.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <string> -#include "iptest.h" -#include "ip_utils.h" -#include "logger.h" -#include "test_utils.h" - -namespace ring { namespace test { - -void IpTest::testIpAddr() -{ - TITLE(); - - IpAddr ip = {"8.8.8.8"}; - CPPUNIT_ASSERT(ip); - CPPUNIT_ASSERT(ip.toString() == "8.8.8.8"); - CPPUNIT_ASSERT(ip.getPort() == 0); - CPPUNIT_ASSERT(ip.isIpv4()); - CPPUNIT_ASSERT(not ip.isIpv6()); - CPPUNIT_ASSERT(not ip.isLoopback()); - CPPUNIT_ASSERT(not ip.isPrivate()); - CPPUNIT_ASSERT(not ip.isUnspecified()); - - IpAddr ip_2 = ip.toString(); - CPPUNIT_ASSERT(ip_2 == ip); - - ip = IpAddr(); - CPPUNIT_ASSERT(not ip); - CPPUNIT_ASSERT(ip.isUnspecified()); - CPPUNIT_ASSERT(not ip.isIpv4()); - CPPUNIT_ASSERT(not ip.isIpv6()); - CPPUNIT_ASSERT(ip.getPort() == 0); - - ip = IpAddr("8.8.8.8:42"); - CPPUNIT_ASSERT(ip); - CPPUNIT_ASSERT(ip.toString() == "8.8.8.8"); - CPPUNIT_ASSERT(ip.getPort() == 42); - - pj_sockaddr_set_port(ip.pjPtr(), 5042); - CPPUNIT_ASSERT(ip.getPort() == 5042); - -#if HAVE_IPV6 - const in6_addr native_ip = {{ - 0x3f, 0xfe, 0x05, 0x01, - 0x00, 0x08, 0x00, 0x00, - 0x02, 0x60, 0x97, 0xff, - 0xfe, 0x40, 0xef, 0xab - }}; - ip = IpAddr(native_ip); - CPPUNIT_ASSERT(ip); - CPPUNIT_ASSERT(ip == IpAddr("3ffe:0501:0008:0000:0260:97ff:fe40:efab")); - CPPUNIT_ASSERT(not ip.isIpv4()); - CPPUNIT_ASSERT(ip.isIpv6()); - - CPPUNIT_ASSERT(IpAddr::isValid("3ffe:0501:0008:0000:0260:97ff:fe40:efab")); - CPPUNIT_ASSERT(IpAddr::isValid("[3ffe:0501:0008:0000:0260:97ff:fe40:efab]")); - CPPUNIT_ASSERT(IpAddr::isValid("[3ffe:0501:0008:0000:0260:97ff:fe40:efab]:4242")); - CPPUNIT_ASSERT(IpAddr::isValid("[3ffe:501:8::260:97ff:fe40:efab]:4242")); -#endif -} - -IpTest::IpTest() : CppUnit::TestCase("IP Tests") {} - -}} // namespace ring::test diff --git a/test/iptest.h b/test/iptest.h deleted file mode 100644 index 33728185fc190b3ee70e4f9079185beaae2f5f3e..0000000000000000000000000000000000000000 --- a/test/iptest.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef IP_TEST_ -#define IP_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -/* - * @file audiobuffertest.cpp - * @brief Regroups unit tests related to an audio buffer. - */ - -namespace ring { namespace test { - -class IpTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(IpTest); - CPPUNIT_TEST(testIpAddr); - CPPUNIT_TEST_SUITE_END(); - - public: - - IpTest(); - - void testIpAddr(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(IpTest, "IpTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(IpTest); - -}} // namespace ring::test - -#endif // IP_TEST_ diff --git a/test/main.cpp b/test/main.cpp deleted file mode 100644 index 3db78303d5139d823e86bc337e74e1f69c9d71ad..0000000000000000000000000000000000000000 --- a/test/main.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "logger.h" -#include "manager.h" -#include "constants.h" -#include "fileutils.h" - -#include <cstdlib> - -#include <cppunit/CompilerOutputter.h> -#include <cppunit/XmlOutputter.h> -#include <cppunit/extensions/TestFactoryRegistry.h> -#include <cppunit/ui/text/TextTestRunner.h> - -namespace { - void restore() - { - if (system("mv " CONFIG_SAMPLE_BAK " " CONFIG_SAMPLE) < 0) - RING_ERR("Restoration of %s failed", CONFIG_SAMPLE); - } - void backup() - { - if (system("cp " CONFIG_SAMPLE " " CONFIG_SAMPLE_BAK) < 0) - RING_ERR("Backup of %s failed", CONFIG_SAMPLE); - } -} - -void cleanup() -{ - int ret = system("killall sipp"); - std::cerr << "Killed all sip processes with status " << ret << std::endl; -} - -int main(int argc, char* argv[]) -{ - atexit(cleanup); - printf("\nRing Daemon Test Suite, by Savoir-faire Linux 2004-2016\n\n"); - setConsoleLog(true); - setDebugMode(true); - ring::fileutils::FileHandle f(ring::fileutils::create_pidfile()); - if (f.fd == -1) { - fprintf(stderr, "An dring instance is already running, quitting...\n"); - return 1; - } - - int argvIndex = 1; - bool xmlOutput = false; - - if (argc > 1) { - if (strcmp("--help", argv[1]) == 0) { - argvIndex++; - - CPPUNIT_NS::Test* suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry("All Tests").makeTest(); - - int testSuiteCount = suite->getChildTestCount(); - printf("Usage: test [OPTIONS] [TEST_SUITE]\n"); - printf("\nOptions:\n"); - printf(" --xml - Output results in an XML file, instead of standard output.\n"); - printf(" --debug - Debug mode\n"); - printf(" --help - Print help\n"); - printf("\nAvailable test suites:\n"); - - for (int i = 0; i < testSuiteCount; i++) { - printf(" - %s\n", suite->getChildTestAt(i)->getName().c_str()); - } - - return 0; - } else if (strcmp("--debug", argv[1]) == 0) { - argvIndex++; - - setDebugMode(true); - RING_INFO("Debug mode activated"); - - } else if (strcmp("--xml", argv[1]) == 0) { - argvIndex++; - - xmlOutput = true; - RING_INFO("Using XML output"); - } - } - - // Default test suite : all tests - std::string testSuiteName = "All Tests"; - - if (argvIndex < argc) { - testSuiteName = argv[argvIndex]; - argvIndex++; - } - - printf("\n\n=== SFLphone initialization ===\n\n"); - backup(); - ring::Manager::instance().init(CONFIG_SAMPLE); - - // Get the top level suite from the registry - printf("\n\n=== Test Suite: %s ===\n\n", testSuiteName.c_str()); - CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(testSuiteName).makeTest(); - - if (suite->getChildTestCount() == 0) { - RING_ERR("Invalid test suite name: %s", testSuiteName.c_str()); - restore(); - return 1; - } - - // Adds the test to the list of test to run - CppUnit::TextTestRunner runner; - runner.addTest(suite); - /* Specify XML output */ - std::ofstream outfile("cppunitresults.xml"); - - if (xmlOutput) { - CppUnit::XmlOutputter* outputter = new CppUnit::XmlOutputter(&runner.result(), outfile); - runner.setOutputter(outputter); - } else { - // Change the default outputter to a compiler error format outputter - runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); - } - - // Run the tests. - bool wasSuccessful = runner.run(); - - printf("=== Test suite ending ===\n"); - ring::Manager::instance().finish(); - - restore(); - - return wasSuccessful ? 0 : 1; -} diff --git a/test/numbercleanertest.cpp b/test/numbercleanertest.cpp deleted file mode 100644 index d39625d2ed50a3fb4843e7bb4d533b8059b93898..0000000000000000000000000000000000000000 --- a/test/numbercleanertest.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <cstdio> -#include <sstream> -#include <dlfcn.h> - -#include "logger.h" - -#include "numbercleanertest.h" - -#define NUMBER_TEST_1 "514 333 4444" -#define NUMBER_TEST_2 "514-333-4444" -#define NUMBER_TEST_3 "(514) 333 4444" -#define NUMBER_TEST_4 "(514)-333-4444" -#define NUMBER_TEST_5 "(514) 333-4444" -#define NUMBER_TEST_6 "514 333 4444" -#define NUMBER_TEST_7 "ext 136" -#define NUMBER_TEST_8 "514 333 4444 ext. 136" -#define NUMBER_TEST_9 "514 333 4444 ext 136" -#define NUMBER_TEST_10 "136" - -#define VALID_NUMBER "5143334444" -#define VALID_PREPENDED_NUMBER "95143334444" -#define VALID_EXTENSION "136" - -namespace ring { namespace test { - -void NumberCleanerTest::test_format_1(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_1 --------------------\n"); - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_1) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_2(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_2 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_2) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_3(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_3 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_3) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_4(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_4 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_4) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_5(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_5 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_5) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_6(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_6 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_6) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_7(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_7 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_7) == VALID_EXTENSION); -} - -void NumberCleanerTest::test_format_8(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_8 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_8) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_9(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_9 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_9) == VALID_NUMBER); -} - -void NumberCleanerTest::test_format_10(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_10 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_1, "9") == VALID_PREPENDED_NUMBER); -} - -void NumberCleanerTest::test_format_11(void) -{ - RING_DBG("-------------------- NumberCleanerTest::test_format_11 --------------------\n"); - - CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_10, "9") == VALID_EXTENSION); -} - -}} // namespace ring::test diff --git a/test/numbercleanertest.h b/test/numbercleanertest.h deleted file mode 100644 index 3990105f1a1ef327f4052e4f6334d54a06fbc28e..0000000000000000000000000000000000000000 --- a/test/numbercleanertest.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -// Application import -#include "numbercleaner.h" -// #include "../src/conference.h" -/* - * @file numbercleanerTest.cpp - * @brief Regroups unitary tests related to the phone number cleanup function. - */ - -#ifndef _NUMBERCLEANER_TEST_ -#define _NUMBERCLEANER_TEST_ - -namespace ring { namespace test { - -class NumberCleanerTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(NumberCleanerTest); - CPPUNIT_TEST(test_format_1); - CPPUNIT_TEST(test_format_2); - CPPUNIT_TEST(test_format_3); - CPPUNIT_TEST(test_format_4); - CPPUNIT_TEST(test_format_5); - CPPUNIT_TEST(test_format_6); - /*CPPUNIT_TEST (test_format_7); - CPPUNIT_TEST (test_format_8); - CPPUNIT_TEST (test_format_9);*/ - CPPUNIT_TEST(test_format_10); - CPPUNIT_TEST_SUITE_END(); - - public: - NumberCleanerTest() : CppUnit::TestCase("Hook Manager Tests") {} - - void test_format_1(); - void test_format_2(); - void test_format_3(); - void test_format_4(); - void test_format_5(); - void test_format_6(); - void test_format_7(); - void test_format_8(); - void test_format_9(); - void test_format_10(); - void test_format_11(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(NumberCleanerTest, "NumberCleanerTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(NumberCleanerTest); - -}} // namespace ring::test - -#endif diff --git a/test/resamplertest.cpp b/test/resamplertest.cpp deleted file mode 100644 index 235bd75ad092eef5937f90495c4aaa1f32baacf4..0000000000000000000000000000000000000000 --- a/test/resamplertest.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <iostream> -#include <iterator> -#include <algorithm> -#include <math.h> - -#include "resamplertest.h" - -namespace ring { namespace test { - -ResamplerTest::ResamplerTest() : - CppUnit::TestCase("Resampler module test"), inputBuffer(MAX_BUFFER_LENGTH, AudioFormat::MONO()), outputBuffer(MAX_BUFFER_LENGTH, AudioFormat::MONO()) -{} - -void ResamplerTest::setUp() -{ - -} - -void ResamplerTest::tearDown() -{ - -} - -namespace { - template <typename T> - void print_buffer(T &buffer) - { -#ifdef VERBOSE - std::copy(buffer.begin(), buffer.end(), - std::ostream_iterator<ring::AudioSample>(std::cout, ", ")); - std::cout << std::endl; -#endif - } -} - -void ResamplerTest::testUpsamplingRamp() -{ - // generate input samples and store them in inputBuffer - generateRamp(); - - std::cout << "Test Upsampling Ramp" << std::endl; - Resampler resampler(44100); - - performUpsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - AudioBuffer tmpOutputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} - -void ResamplerTest::testDownsamplingRamp() -{ - generateRamp(); - - std::cout << "Test Downsampling Ramp" << std::endl; - Resampler resampler(44100); - - performDownsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - AudioBuffer tmpOutputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} - -void ResamplerTest::testUpsamplingTriangle() -{ - generateTriangularSignal(); - - std::cout << "Test Upsampling Triangle" << std::endl; - Resampler resampler(44100); - - performUpsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - AudioBuffer tmpOutputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} - -void ResamplerTest::testDownsamplingTriangle() -{ - generateTriangularSignal(); - - std::cout << "Test Downsampling Triangle" << std::endl; - Resampler resampler(44100); - - performDownsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - AudioBuffer tmpOutputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} -void ResamplerTest::testUpsamplingSine() -{ - // generate input samples and store them in inputBuffer - generateSineSignal(); - - std::cout << "Test Upsampling Sine" << std::endl; - Resampler resampler(44100); - - performUpsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - AudioBuffer tmpOutputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} - -void ResamplerTest::testDownsamplingSine() -{ - // generate input samples and store them in inputBuffer - generateSineSignal(); - - std::cout << "Test Downsampling Sine" << std::endl; - Resampler resampler(44100); - - performDownsampling(resampler); - - AudioBuffer tmpInputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - AudioBuffer tmpOutputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - - tmpInputBuffer.copy(inputBuffer); - std::cout << "Input Buffer" << std::endl; - print_buffer(*tmpInputBuffer.getChannel(0)); - - tmpOutputBuffer.copy(outputBuffer); - std::cout << "Output Buffer" << std::endl; - print_buffer(*tmpOutputBuffer.getChannel(0)); -} - -void ResamplerTest::generateRamp() -{ - std::vector<ring::AudioSample>* buf = inputBuffer.getChannel(0); - for (size_t i = 0; i < buf->size(); ++i) - (*buf)[i] = i; -} - -void ResamplerTest::generateTriangularSignal() -{ - std::vector<ring::AudioSample>* buf = inputBuffer.getChannel(0); - for (size_t i = 0; i < buf->size(); ++i) - (*buf)[i] = i * 10; -} - -void ResamplerTest::generateSineSignal() -{ - std::vector<ring::AudioSample>* buf = inputBuffer.getChannel(0); - for (size_t i = 0; i < buf->size(); ++i) - (*buf)[i] = (ring::AudioSample) (1000.0 * sin(i)); -} - -void ResamplerTest::performUpsampling(Resampler &resampler) -{ - AudioBuffer tmpInputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - AudioBuffer tmpOutputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - - for (size_t i = 0, j = 0; i < (inputBuffer.frames() / 2); i += tmpInputBuffer.frames(), j += tmpOutputBuffer.frames()) { - tmpInputBuffer.copy(inputBuffer, i); - resampler.resample(tmpInputBuffer, tmpOutputBuffer); - outputBuffer.copy(tmpOutputBuffer, -1, 0, j); - } -} - -void ResamplerTest::performDownsampling(Resampler &resampler) -{ - AudioBuffer tmpInputBuffer(TMP_HIGHSMPLR_BUFFER_LENGTH, AudioFormat(16000, 1)); - AudioBuffer tmpOutputBuffer(TMP_LOWSMPLR_BUFFER_LENGTH, AudioFormat::MONO()); - - for (size_t i = 0, j = 0; i < inputBuffer.frames(); i += tmpInputBuffer.frames(), j += tmpOutputBuffer.frames()) { - tmpInputBuffer.copy(inputBuffer, i); - resampler.resample(tmpInputBuffer, tmpOutputBuffer); - outputBuffer.copy(tmpOutputBuffer, -1, 0, j); - } -} - -}} // namespace ring::test diff --git a/test/resamplertest.h b/test/resamplertest.h deleted file mode 100644 index 6cb2a11e0b304e54dd3ffa2482e584a10b81ceb9..0000000000000000000000000000000000000000 --- a/test/resamplertest.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2012-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef _RESAMPLER_TEST_ -#define _RESAMPLER_TEST_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include "audio/resampler.h" -#include "noncopyable.h" - -#define MAX_BUFFER_LENGTH 40000 -#define TMP_LOWSMPLR_BUFFER_LENGTH 160 -#define TMP_HIGHSMPLR_BUFFER_LENGTH 320 - -namespace ring { namespace test { - -class ResamplerTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(ResamplerTest); - CPPUNIT_TEST(testUpsamplingRamp); - CPPUNIT_TEST(testDownsamplingRamp); - CPPUNIT_TEST(testUpsamplingTriangle); - CPPUNIT_TEST(testDownsamplingTriangle); - CPPUNIT_TEST(testUpsamplingSine); - CPPUNIT_TEST(testDownsamplingSine); - CPPUNIT_TEST_SUITE_END(); - - public: - ResamplerTest(); - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - void tearDown(); - - /* - * Generate a ramp and upsamples it form 8kHz to 16kHz - */ - void testUpsamplingRamp(); - - /* - * Generate a ramp and downsamples it from 16kHz to 8kHz - */ - void testDownsamplingRamp(); - - /* - * Generate a triangular signal and upsamples it from 8kHz to 16kHz - */ - void testUpsamplingTriangle(); - - /* - * Generate a triangular signal and downsamples it from 16kHz to 8kHz - */ - void testDownsamplingTriangle(); - - /* - * Generate a sine signal and upsamples it from 8kHz to 16kHz - */ - void testUpsamplingSine(); - - /* - * Generate a sine signal and downsamples it from 16kHz to 8kHz - */ - void testDownsamplingSine(); - -private: - NON_COPYABLE(ResamplerTest); - - /* - * Generate a ramp to be stored in inputBuffer - */ - void generateRamp(); - - /* - * Generate a triangular signal to be stored in inputBuffer - */ - void generateTriangularSignal(); - - /* - * Generate a sine signal to be stored in inputBuffer - */ - void generateSineSignal(); - - /* - * Perform upsampling on the whole input buffer - */ - void performUpsampling(ring::Resampler &resampler); - - /* - * Perform downsampling on the whold input buffer - */ - void performDownsampling(ring::Resampler &resampler); - - /** - * Used to store input samples - */ - ring::AudioBuffer inputBuffer; - - /** - * Used to receive output samples - */ - ring::AudioBuffer outputBuffer; -}; - -/* Register the test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ResamplerTest, "ResamplerTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(ResamplerTest); - -}} // namespace ring::test - -#endif // _RESAMPLER_TEST_ diff --git a/test/ringbufferpooltest.cpp b/test/ringbufferpooltest.cpp deleted file mode 100644 index 43de28703ba329880e07eee1fc9c630237492513..0000000000000000000000000000000000000000 --- a/test/ringbufferpooltest.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <string> -#include <memory> - -#include "ringbufferpooltest.h" -#include "audio/ringbufferpool.h" -#include "audio/ringbuffer.h" -#include "logger.h" -#include "test_utils.h" - -namespace ring { namespace test { - -void RingBufferPoolTest::testBindUnbindBuffer() -{ - TITLE(); - - std::string test_id1 = "bind unbind 1"; - std::string test_id2 = "bind unbind 2"; - - // bind test_id1 with RingBufferPool::DEFAULT_ID (test_id1 not already created) - rbPool_->bindCallID(test_id1, RingBufferPool::DEFAULT_ID); - - // unbind test_id1 with RingBufferPool::DEFAULT_ID - rbPool_->unBindCallID(test_id1, RingBufferPool::DEFAULT_ID); - - rbPool_->bindCallID(test_id1, RingBufferPool::DEFAULT_ID); - rbPool_->bindCallID(test_id1, RingBufferPool::DEFAULT_ID); - - rbPool_->bindCallID(test_id2, RingBufferPool::DEFAULT_ID); - rbPool_->bindCallID(test_id2, RingBufferPool::DEFAULT_ID); - - // bind test_id1 with test_id2 (both testid1 and test_id2 already created) - // calling it twice not supposed to break anything - rbPool_->bindCallID(test_id1, test_id2); - rbPool_->bindCallID(test_id1, test_id2); - - rbPool_->unBindCallID(test_id1, test_id2); - rbPool_->unBindCallID(test_id1, test_id2); - - rbPool_->unBindCallID(RingBufferPool::DEFAULT_ID, test_id2); - rbPool_->unBindCallID(RingBufferPool::DEFAULT_ID, test_id2); - - rbPool_->unBindCallID(RingBufferPool::DEFAULT_ID, test_id1); - - // test unbind all function - rbPool_->bindCallID(RingBufferPool::DEFAULT_ID, test_id1); - rbPool_->bindCallID(RingBufferPool::DEFAULT_ID, test_id2); - rbPool_->bindCallID(test_id1, test_id2); - - rbPool_->unBindAll(test_id2); -} - -void RingBufferPoolTest::testGetPutData() -{ - TITLE(); - - std::string test_id = "incoming rtp session"; - - auto mainRingBuffer = rbPool_->getRingBuffer(RingBufferPool::DEFAULT_ID); - auto testRingBuffer = rbPool_->createRingBuffer(test_id); - - rbPool_->bindCallID(test_id, RingBufferPool::DEFAULT_ID); - - ring::AudioSample test_sample1 = 12; - ring::AudioSample test_sample2 = 13; - - AudioBuffer test_input1(&test_sample1, 1, AudioFormat::MONO()); - AudioBuffer test_input2(&test_sample2, 1, AudioFormat::MONO()); - AudioBuffer test_output(100, AudioFormat::MONO()); - - // get by test_id without preleminary put - CPPUNIT_ASSERT(rbPool_->getData(test_output, test_id) == 0); - - // put by RingBufferPool::DEFAULT_ID, get by test_id - mainRingBuffer->put(test_input1); - CPPUNIT_ASSERT(rbPool_->getData(test_output, test_id) == 1); - CPPUNIT_ASSERT(test_sample1 == (*test_output.getChannel(0))[0]); - - // get by RingBufferPool::DEFAULT_ID without preleminary put - CPPUNIT_ASSERT(rbPool_->getData(test_output, RingBufferPool::DEFAULT_ID) == 0); - - // put by test_id, get by RingBufferPool::DEFAULT_ID - testRingBuffer->put(test_input2); - CPPUNIT_ASSERT(rbPool_->getData(test_output, RingBufferPool::DEFAULT_ID) == 1); - CPPUNIT_ASSERT(test_sample2 == (*test_output.getChannel(0))[0]); - - rbPool_->unBindCallID(test_id, RingBufferPool::DEFAULT_ID); -} - -void RingBufferPoolTest::testGetAvailableData() -{ - TITLE(); - std::string test_id = "getData putData"; - std::string false_id = "false id"; - - auto mainRingBuffer = rbPool_->getRingBuffer(RingBufferPool::DEFAULT_ID); - auto testRingBuffer = rbPool_->createRingBuffer(test_id); - - rbPool_->bindCallID(test_id, RingBufferPool::DEFAULT_ID); - - ring::AudioSample test_sample1 = 12; - ring::AudioSample test_sample2 = 13; - - AudioBuffer test_input1(&test_sample1, 1, AudioFormat::MONO()); - AudioBuffer test_input2(&test_sample2, 1, AudioFormat::MONO()); - AudioBuffer test_output(1, AudioFormat::MONO()); - AudioBuffer test_output_large(100, AudioFormat::MONO()); - - // put by RingBufferPool::DEFAULT_ID get by test_id without preleminary put - CPPUNIT_ASSERT(rbPool_->availableForGet(test_id) == 0); - CPPUNIT_ASSERT(rbPool_->getAvailableData(test_output, test_id) == 0); - - // put by RingBufferPool::DEFAULT_ID, get by test_id - mainRingBuffer->put(test_input1); - CPPUNIT_ASSERT(rbPool_->availableForGet(test_id) == 1); - - // get by RingBufferPool::DEFAULT_ID without preliminary input - CPPUNIT_ASSERT(rbPool_->availableForGet(test_id) == 0); - CPPUNIT_ASSERT(rbPool_->getData(test_output_large, test_id) == 0); - - // put by test_id get by test_id - testRingBuffer->put(test_input2); - CPPUNIT_ASSERT(rbPool_->availableForGet(test_id) == 1); - CPPUNIT_ASSERT(rbPool_->getData(test_output_large, test_id) == 1); - CPPUNIT_ASSERT(rbPool_->availableForGet(test_id) == 0); - CPPUNIT_ASSERT((*test_output_large.getChannel(0))[0] == test_sample2); - - // get by false id - CPPUNIT_ASSERT(rbPool_->getData(test_output_large, false_id) == 0); - - rbPool_->unBindCallID(test_id, RingBufferPool::DEFAULT_ID); -} - -void RingBufferPoolTest::testDiscardFlush() -{ - TITLE(); - std::string test_id = "flush discard"; - - auto mainRingBuffer = rbPool_->getRingBuffer(RingBufferPool::DEFAULT_ID); - auto testRingBuffer = rbPool_->createRingBuffer(test_id); - - rbPool_->bindCallID(test_id, RingBufferPool::DEFAULT_ID); - - ring::AudioSample test_sample1 = 12; - AudioBuffer test_input1(&test_sample1, 1, AudioFormat::MONO()); - - testRingBuffer->put(test_input1); - rbPool_->discard(1, RingBufferPool::DEFAULT_ID); - - rbPool_->discard(1, test_id); - - mainRingBuffer->put(test_input1); - - rbPool_->discard(1, test_id); - - rbPool_->unBindCallID(test_id, RingBufferPool::DEFAULT_ID); -} - -void RingBufferPoolTest::testConference() -{ - TITLE(); - - std::string test_id1 = "participant A"; - std::string test_id2 = "participant B"; - - auto mainRingBuffer = rbPool_->getRingBuffer(RingBufferPool::DEFAULT_ID); - auto testRingBuffer1 = rbPool_->createRingBuffer(test_id1); - auto testRingBuffer2 = rbPool_->createRingBuffer(test_id2); - - // test bind Participant A with default - rbPool_->bindCallID(test_id1, RingBufferPool::DEFAULT_ID); - - // test bind Participant B with default - rbPool_->bindCallID(test_id2, RingBufferPool::DEFAULT_ID); - - // test bind Participant A with Participant B - rbPool_->bindCallID(test_id1, test_id2); - - ring::AudioSample testint = 12; - AudioBuffer testbuf(&testint, 1, AudioFormat::MONO()); - - // put data test ring buffers - mainRingBuffer->put(testbuf); - - // put data test ring buffers - testRingBuffer1->put(testbuf); - testRingBuffer2->put(testbuf); -} - -RingBufferPoolTest::RingBufferPoolTest() - : CppUnit::TestCase("Audio Layer Tests") , rbPool_(new RingBufferPool) -{} - -}} // namespace ring::test diff --git a/test/ringbufferpooltest.h b/test/ringbufferpooltest.h deleted file mode 100644 index 7db0312954c7c6c7f759252e8aa57c5ba030fb8c..0000000000000000000000000000000000000000 --- a/test/ringbufferpooltest.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef RINGBUFFERPOOL_TEST_ -#define RINGBUFFERPOOL_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <memory> - -/* - * @file audiorecorderTest.cpp - * @brief Regroups unit tests related to the main buffer. - */ - -namespace ring { -class RingBufferPool; -} // namespace ring - -namespace ring { namespace test { - -class RingBufferPoolTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(RingBufferPoolTest); - CPPUNIT_TEST(testBindUnbindBuffer); - CPPUNIT_TEST(testGetPutData); - CPPUNIT_TEST(testDiscardFlush); - CPPUNIT_TEST(testConference); - CPPUNIT_TEST_SUITE_END(); - - public: - - RingBufferPoolTest(); - - void testBindUnbindBuffer(); - - void testGetPutData(); - - void testGetAvailableData(); - - void testDiscardFlush(); - - void testConference(); - - private: - - std::unique_ptr<ring::RingBufferPool> rbPool_; -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(RingBufferPoolTest, "RingBufferPoolTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(RingBufferPoolTest); - -}} // namespace ring::test - -#endif // RINGBUFFERPOOL_TEST_ diff --git a/test/run_tests.sh b/test/run_tests.sh deleted file mode 100755 index 9c48398b37b4193cb726c4462face8f42811bfbd..0000000000000000000000000000000000000000 --- a/test/run_tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# print out env first for debugging -env -CODECS_PATH="../src/audio/codecs" exec ./test --xml diff --git a/test/scripts/presence_test.py b/test/scripts/presence_test.py deleted file mode 100755 index 81a4a1aed0514bd33f99001ac4079c567aa811fd..0000000000000000000000000000000000000000 --- a/test/scripts/presence_test.py +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -print "\ -# --SFLPhone-- #\n\ -# #\n\ -# copyright: Savoir-faire Linux (2013) #\n\ -# author: Patrick keroulas <patrick.keroulas@savoirfairelinux.com> #\n\ -# description: This script sends a sequence of methods to the daemon #\n\ -# through the dbus to test the presence feature of SFLPhone. #\n\ -# SET THE PARAMS IS THE 'data' SECTION OF THIS SCRIPT BEFORE #\n\ -# YOU EXECUTE IT. 'The normal mode process the tasks #\n\ -# in order while the random mode generates a random sequence #\n\ -# A Freeswitch server must be setup since it supports PUBLISH #\n\ -# requests and Asterisk doesn't. #\n\ -# The user must have 2 valid accounts. This script will #\n\ -# use the first account in the list and the IP2IP account. #\n\ -# This is a self subscribe test, set another buddy IP if needed#\n\ -#\n" - - - -import time, sys, gobject -from random import randint -import dbus, dbus.mainloop.glib -import logging, commands - - -#----------------- logger to file and stdout ------------------------------ -f = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' -logfile = 'sflphone_doombot.log' -logging.basicConfig(filename=logfile,level=logging.INFO,format=f) # log to file -logger = logging.getLogger() -ch = logging.StreamHandler(sys.stdout) #log to console -ch.setLevel(logging.INFO) -formatter = logging.Formatter(f) -ch.setFormatter(formatter) -logger.addHandler(ch) - -#------------------ Initialise DBUS ------------------------------ -dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) -bus = dbus.SessionBus() -presenceManagerBus = bus.get_object('cx.ring.Ring', '/cx/ring/Ring/PresenceManager') -presenceManager = dbus.Interface(presenceManagerBus, dbus_interface='cx.ring.Ring.PresenceManager') -configurationManagerBus = bus.get_object('cx.ring.Ring', '/cx/ring/Ring/ConfigurationManager') -configurationManager = dbus.Interface(configurationManagerBus, dbus_interface='cx.ring.Ring.ConfigurationManager') - - -#------------------------- General purpose functions ---------------------------- - -#Get the first non-IP2IP account -def get_first_account(): - accounts = configurationManager.getAccountList() - for i, v in enumerate(accounts): - if v != "IP2IP": - details = configurationManager.getAccountDetails(v) - if details["Account.type"] == True or details["Account.type"] == "SIP": - return v - return "IP2IP" - -def get_account_list(): - accounts = configurationManager.getAccountList() - result = [] - for i, v in enumerate(accounts): - if v != "IP2IP": - details = configurationManager.getAccountDetails(v) - if details["Account.type"] == True or details["Account.type"] == "SIP": - result.append(v) - return result - -def registerSend(arg): - configurationManager.sendRegister(arg['acc'],arg['enable']) - logging.info('> REGISTER : '+ str(arg)) - -#------------------------- Presence functions ---------------------------- - -def presSubscribe(arg): - presenceManager.subscribeBuddy(arg['acc'],arg['buddy'],arg['flag']) - logging.info('> SUBSCRIBE to ' + str(arg)) - -def presSend(arg): - presenceManager.publish(arg['acc'],arg['status'],arg['note']) - logging.info('> PUBLISH ' + str(arg)) - -def presSubApprove(arg): - presenceManager.answerServerRequest(arg['uri'],arg['flag']) - logging.info('> APPROVE subscription from' + str(arg)) - -def newPresSubCientNotificationHandler(acc, uri, status, activity): - logging.info("< SIGNAL : Notification for acc:"+str(acc)+", from:"+str(uri)+" (status:" + str(status)+ ", "+ str(activity)+ ").") - -def newPresSubServerRequestHandler(uri): - logging.info("< SIGNAL : PresenceSubscription request from " +str(uri)) - subscriber_uri = uri - -def subcriptionStateChangedHandler(acc,uri,flag): - logging.info("< SIGNAL : new subscriptionState request for acc:"+str(acc)+" uri " +str(uri) + " flag:" + str(flag)) - -def serverErrorHandler(acc, error, msg): - logging.info("< SIGNAL : error from server:"+str(error)+" . "+str(msg)) - -def randbool(): - return bool(randint(0,1)) - -#--------------------------- Data ------------------------------- - -TEST_DURATION = 30 # in sec -acc_1 = get_account_list()[0] -print 'acc_1 : ' + str(acc_1) -acc_2 = get_account_list()[1] -print 'acc_2 : ' + str(acc_2) -IP2IP = 'IP2IP' -server_ip = '192.95.9.63' # asterisk test server - -host_user = '6001' -host_ip = '192.168.50.196' -host_uri = '<sip:'+host_user+'@'+server_ip+'>' - -buddy_uri_1 = '<sip:6001@'+server_ip+'>' -buddy_uri_2 = '<sip:6002@'+server_ip+'>' -buddy_ip = host_ip # self subscribing -buddy_ip_uri = '<sip:'+buddy_ip+'>' # IP2IP -subscriber_uri = '' - -#---------------------------- Sequence ---------------------------- - -start_time = 0 -task_count = 0 -task_N = 0 - -SEQ_MODE_NORMAL = 0 -SEQ_MODE_RANDOM = 1 -sequence_mode = SEQ_MODE_NORMAL - - -# regular test -task_list = [ - - (registerSend,{'acc':acc_1, 'enable':True}), - (presSubscribe, {'acc':acc_1,'buddy':buddy_uri_1,'flag':True}), - - (registerSend,{'acc':acc_2, 'enable':True}), - (presSubscribe, {'acc':acc_2,'buddy':buddy_uri_2,'flag':True}), - - (presSend, {'acc':acc_2,'status':randbool(),'note':buddy_uri_1+'is here!'}), - (presSend, {'acc':acc_1,'status':randbool(),'note':buddy_uri_2+'is here'}), - - (presSubscribe, {'acc':acc_1,'buddy':'<sip:6003@192.95.9.63>','flag':True}), - - (registerSend,{'acc':acc_1, 'enable':False}), - (presSubscribe, {'acc':acc_2,'buddy':buddy_uri_2,'flag':False}), - - (registerSend,{'acc':acc_2, 'enable':False}), - (presSubscribe, {'acc':acc_1,'buddy':buddy_uri_1,'flag':False}), -] - - -""" -# simple sub -task_list = [ - - (presSubscribe, {'acc':acc_2,'buddy':buddy_uri_2,'flag':True}), - (presSubscribe, {'acc':acc_2,'buddy':'<sip:6003@192.95.9.63>','flag':True}), -] -""" - -""" -# IP2IP -task_list = [ - (presSubscribe, {'acc': IP2IP,'buddy':buddy_ip_uri,'flag':True}), - (presSend, {'acc': IP2IP,'status':randbool(),'note':'This notify should not be recieved'}), - (presSubApprove, {'uri':subscriber_uri,'flag':randbool()}), - (presSend, {'acc': IP2IP,'status':randbool(),'note':'Oh yeah!'}), - (presSubscribe, {'acc': IP2IP,'buddy':buddy_ip_uri,'flag':False}), -] -""" - - -def run(): - - if sequence_mode == SEQ_MODE_NORMAL: - global task_count - task_index = task_count%task_N - task_count += 1 - if task_count == task_N+1: # one loop - return - - elif sequence_mode == SEQ_MODE_RANDOM: - task_index = randint(0,task_N-1) - - task_list[task_index][0](task_list[task_index][1]) - - if(int(time.time()-start_time) < TEST_DURATION): - gobject.timeout_add(2000, run) # const time step in ms - #gobject.timeout_add(randint(50,2000), run) # random time step in ms - else: - logging.info("Test sequence finished") - # TODO clear dbus sessio. Unfortunately stackoverflow.com is down today - - -if __name__ == '__main__': - - try: - # dbus signal monitor - presenceManagerBus.connect_to_signal("newBuddyNotification", newPresSubCientNotificationHandler, dbus_interface='cx.ring.Ring.PresenceManager') - presenceManagerBus.connect_to_signal("newServerSubscriptionRequest", newPresSubServerRequestHandler, dbus_interface='cx.ring.Ring.PresenceManager') - presenceManagerBus.connect_to_signal("subcriptionStateChanged", subcriptionStateChangedHandler, dbus_interface='cx.ring.Ring.PresenceManager') - presenceManagerBus.connect_to_signal("serverError", serverErrorHandler, dbus_interface='cx.ring.Ring.PresenceManager') - - start_time = time.time() - task_N = len(task_list) - #sequence_mode = SEQ_MODE_RANDOM - - run() - - except Exception as e: - print e - - loop = gobject.MainLoop() - loop.run() diff --git a/test/scripts/stress_test.py b/test/scripts/stress_test.py deleted file mode 100755 index 4d4a608f7f46954048d5e7f9e09a9f87824ca808..0000000000000000000000000000000000000000 --- a/test/scripts/stress_test.py +++ /dev/null @@ -1,421 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -print "\ -# --SFLphone-- #\n\ -# /¯¯¯¯\ /¯¯¯¯\ /¯¯¯¯\ /¯¯¯\_/¯¯¯\ /¯¯¯¯¯\ /¯¯¯¯\ |¯¯¯¯¯¯¯| #\n\ -# / /¯\ | / /\ \ /\ \| /¯\ /¯\ | | |¯| | | /\ | ¯¯| |¯¯ #\n\ -# / / / |/ | | | | | || | | | | | | ¯ < | | | | | | #\n\ -# / /__/ / | ¯ | ¯ || | | | | | | |¯| | | |_| | | | #\n\ -# |______/ \_____/ \____/ |_| |_| |_| \_____/ \____/ |_| #\n\ -# #\n\ -# _Version 2.0_ #\n\ -# #\n\ -# copyright: Savoir-faire Linux (2012-2013) #\n\ -# author: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> #\n\ -# description: This script perform stress tests to trigger rare race #\n\ -# conditions or ASSERT caused by excessive load. This script #\n\ -# should, in theory, never crash or end the sflphone daemon #\n" - -import dbus -import time -import sys -import os -from random import randint - -#---------------------------------------------------------------------# -# # -# Variables # -# # -#---------------------------------------------------------------------# - -#Initialise DBUS -bus = dbus.SessionBus() -callManagerBus = None -callManager = None -configurationManagerBus = None -configurationManager = None -instanceManagerBus = None -instanceManager = None - -#SFLphone -first_account = None -first_iax_account = None -first_account_number = None - -#GDB observer -gdbScriptPath = os.path.dirname(os.path.abspath(__file__))+"/gdb_wrapper.py" -gdbWrapperCommand = "gdb -x "+gdbScriptPath+" > /dev/null 2> /dev/null &" - -#Numbers -sip_number_1 = "7001" -sip_number_2 = "7000" -sip_unreg = "7002" - -#Messages -global_info = "" - - -#---------------------------------------------------------------------# -# # -# Initialization # -# # -#---------------------------------------------------------------------# - -#Start the GDB plugin -def start_daemon(): - #os.system(gdbWrapperCommand) - #time.sleep(10) - reInit() - -#Stop the daemon normally, do it 3 time to be sure it will unregister everyone -def stop_daemon(): - print("Stopping daemon") - try: - instanceManager.Unregister(123) - instanceManager.Unregister(123) - instanceManager.Unregister(123) - except: - #Nothing, it is normal - print("") - -#Connect DBUS -def reInit(): - try: - global callManagerBus,callManager,configurationManagerBus,configurationManager,instanceManagerBus,instanceManager - callManagerBus = bus.get_object('cx.ring.Ring', '/cx/ring/Ring/CallManager') - callManager = dbus.Interface(callManagerBus, dbus_interface='cx.ring.Ring.CallManager') - configurationManagerBus = bus.get_object('cx.ring.Ring', '/cx/ring/Ring/ConfigurationManager') - configurationManager = dbus.Interface(configurationManagerBus, dbus_interface='cx.ring.Ring.ConfigurationManager') - instanceManagerBus = bus.get_object('cx.ring.Ring', '/cx/ring/Ring/Instance') - instanceManager = dbus.Interface(instanceManagerBus , dbus_interface='cx.ring.Ring.Instance') - instanceManager.Register(123,"doombot") - global first_account,first_iax_account,first_account_number - first_account = get_first_account() - first_iax_account = get_first_iax_account() - first_account_number = get_account_number(first_account) - except dbus.exceptions.DBusException: - time.sleep(0.5) - reInit() - -#---------------------------------------------------------------------# -# # -# Tools # -# # -#---------------------------------------------------------------------# - -#Get the first non-IP2IP account -def get_first_account(): - accounts = configurationManager.getAccountList() - for i, v in enumerate(accounts): - if v != "IP2IP": - details = configurationManager.getAccountDetails(v) - if (details["Account.type"] == True or details["Account.type"] == "SIP") \ - and details['Account.registrationStatus'] == "REGISTERED": - return v - return "IP2IP" - -#Get the first IAX account -def get_first_iax_account(): - accounts = configurationManager.getAccountList() - for i, v in enumerate(accounts): - if v != "IP2IP": - details = configurationManager.getAccountDetails(v) - if details["Account.type"] != True and details["Account.type"] != "SIP": - return v - return "IP2IP" - -def get_account_number(account): - details = configurationManager.getAccountDetails(account) - return details["Account.username"] - -def answer_all_calls(): - calls = callManager.getCallList() - for i, v in enumerate(calls): - details = callManager.getCallDetails(v) - if details["CALL_STATE"] == "INCOMING": - callManager.accept(v) - -#Return true is the account is registered -def check_account_state(account): - details = configurationManager.getAccountDetails(account) - #details = {'test':1,'test2':2,'registrationStatus':3} - return details['Account.registrationStatus'] == "REGISTERED" - -#Meta test, common for all tests -def meta_test(test_func): - retCode = 0 - for y in range(0,15): - for x in range(0,10): - try: - ret = test_func() - if ret and ret['code'] > 0: - #print " \033[0;33m"+ret['error']+"\033[0m" - retCode = 1 - sys.stdout.write('X') - except dbus.exceptions.DBusException: - retCode = 1 - sys.stdout.write('X') - reInit() - sys.stdout.write('#') - sys.stdout.flush() - if retCode == 0: - sys.stdout.write(' \033[92m(Success)\033[0m\n') - else: - sys.stdout.write(' \033[91m(Failure)\033[0m\n') - return retCode - -#Add a new test -suits = {} -def add_to_suit(test_suite_name,test_name,test_func): - if not test_suite_name in suits: - suits[test_suite_name] = [] - suits[test_suite_name].append({'test_name':test_name,'test_func':test_func}) - -# Run tests -def run(): - counter = 1 - results = {} - for k in suits.keys(): - print "\n\033[1mExecuting \""+str(k)+"\" tests suit:\033[0m ("+str(counter)+"/"+str(len(suits))+")" - for i, v in enumerate(suits[k]): - #Start SFLphone - start_daemon() - sys.stdout.write(" ["+str(i+1)+"/"+str(len(suits[k]))+"] Testing \""+v['test_name']+"\": ") - sys.stdout.flush() - - #Run the test - retval = meta_test(v['test_func']) - if not k in results: - results[k] = 0 - if retval > 0: - results[k]= results[k] + 1 - - #Stop SFLphone - stop_daemon() - time.sleep(15) - try: - #Try to read the GDB wrapper report - with open('/tmp/doombotReport') as report: - print "Test results:" - print report.read() - except IOError: - print 'Report not found' - counter = counter + 1 - - #Print the test summary - print "\n\n\033[1mSummary:\033[0m" - totaltests = 0 - totalsuccess = 0 - for k in suits.keys(): - print " Suit \""+k+"\": "+str(len(suits[k])-results[k])+"/"+str(len(suits[k])) - totaltests = totaltests + len(suits[k]) - totalsuccess = totalsuccess + len(suits[k])-results[k] - - print "\nTotal: "+str(totalsuccess)+"/"+str(totaltests)+", "+str(totaltests-totalsuccess)+" failures" - - - - -#---------------------------------------------------------------------# -# # -# Unit Tests # -# # -#---------------------------------------------------------------------# - -# This unit case test the basic senario of calling asterisk/freeswitch and then hanging up -# It call itself to make the test simpler, this also test answering up as a side bonus -def stress_answer_hangup_server(): - details = configurationManager.getAccountDetails(first_account) - callManager.placeCall(first_account,sip_number_2) - time.sleep(0.05) - calls = callManager.getCallList() - - # Check if the call worked - if len(calls) < 2: - if not check_account_state(first_account): - #TODO Try to register again instead of failing - return {'code':2,'error':"Unit test \"stress_answer_hangup_server\" failed: Account went unregistered"} - else: - return {'code':1,'error':"Unit test \"stress_answer_hangup_server\" failed: Error while placing call, there is "+str(len(calls))+" calls"} - else: - #Accept the calls - for i, v in enumerate(calls): - time.sleep(0.05) - callManager.accept(v) - callManager.accept(v) - callManager.accept(v) - callManager.accept(v) - callManager.placeCall(first_account,sip_number_2) - - #Hang up - callManager.hangUp(calls[0]) - calls = callManager.getCallList() - for i, v in enumerate(calls): - callManager.hangUp(v) - return {'code':0,'error':""} -add_to_suit("Place call",'Place, answer and hangup',stress_answer_hangup_server) - - - -# This test is similar to stress_answer_hangup_server, but test using IP2IP calls -def stress_answer_hangup_IP2IP(): - callManager.placeCall(first_account,"sip:127.0.0.1") - time.sleep(0.05) - calls = callManager.getCallList() - - # Check if the call worked - if len(calls) < 2: - if not check_account_state(first_account): - #TODO Try to register again instead of failing - return {'code':2,'error':"\nUnit test \"stress_answer_hangup_server\" failed: Account went unregistered"} - else: - return {'code':1,'error':"\nUnit test \"stress_answer_hangup_server\" failed: Error while placing call, there is "+str(len(calls))+" calls"} - else: - #Accept the calls - for i, v in enumerate(calls): - time.sleep(0.05) - callManager.accept(v) - #Hang up - callManager.hangUp(calls[0]) - return {'code':0,'error':""} -add_to_suit("Place call",'Place, answer and hangup (IP2IP)',stress_answer_hangup_IP2IP) - -# Test various type of transfers between various type of calls -# Use both localhost, SIP and IAX -def stress_transfers(): - for i in range(0,50): #repeat the tests - for j in range(0,3): # alternate between IP2IP, SIP and IAX - for k in range(0,2): #alternate between classic transfer and attended one - acc1 = "" - if j == 0: - acc1 = first_account - elif j == 1: - acc1 = "IP2IP" - else: - acc1 = first_iax_account - acc2 = "" - if i%3 == 0: #Use the first loop to shuffle second account type - acc2 = first_account - global_info = "Using SIP Account" - elif i%3 == 1: - acc2 = "IP2IP" - global_info = "Using IP2IP" - else: - acc2 = first_iax_account - global_info = "Using IAX account" - #print "ACC1"+acc1+" ACC2 "+acc2+ " FIRST IAX "+ first_iax_account +" FISRT "+first_account - destination_number = "" - if acc2 == "IP2IP": - destination_number = "sip:127.0.0.1" - else: - destination_number = configurationManager.getAccountDetails(acc2)["Account.username"] - callManager.placeCall(acc1,destination_number) - second_call = None - if k == 1: - callManager.placeCall(acc1,sip_number_1) - answer_all_calls() - - if k == 1: - first_call = None - calls = callManager.getCallList() - for i, v in enumerate(calls): - if first_call == None: - first_call = v - else: - callManager.attendedTransfer(v,first_call) - else: - calls = callManager.getCallList() - for i, v in enumerate(calls): - callManager.transfer(v,destination_number) -#add_to_suit("Transfer",'Make calls and transfer them',stress_transfers) - - -# This test make as tons or calls, then hangup them all as fast as it can -def stress_concurent_calls(): - for i in range(0,5): #repeat the tests - for j in range(0,3): # alternate between IP2IP, SIP and IAX - acc1 = "" - if j == 0: - acc1 = first_account - global_info = "Using SIP" - elif j == 1: - acc1 = "IP2IP" - global_info = "Using IP2IP" - else: - acc1 = first_iax_account - global_info = "Using IAX" - acc2 = "" - if i%3 == 0: #Use the first loop to shuffle second account type - acc2 = first_account - elif i%3 == 1: - acc2 = "IP2IP" - else: - acc2 = first_iax_account - #print "ACC1"+acc1+" ACC2 "+acc2+ " FIRST IAX "+ first_iax_account +" FISRT "+first_account - destination_number = "" - if acc2 == "IP2IP": - destination_number = "sip:127.0.0.1" - else: - destination_number = configurationManager.getAccountDetails(acc2)["Account.username"] - callManager.placeCall(acc1,destination_number) - calls = callManager.getCallList() - for i, v in enumerate(calls): - callManager.hangUp(v) -add_to_suit("Place call",'Many simultanious calls (IP2IP)',stress_concurent_calls) - -# Test if SFLPhone can handle more than 50 simultanious IP2IP call over localhost -# Using localhost to save bandwidth, this is about concurent calls, not network load -#def stress_concurent_calls(): - - ## Create 50 calls - #for i in range(0,50): - #callManager.placeCall(first_account,str(randint(100000000,100000000000)),"sip:127.0.0.1") - - ##TODO check if the could is right - - ## Accept all calls that worked - #calls = callManager.getCallList() - #for i, v in enumerate(calls): - #callManager.accept(v) - - ## Hang up all calls - #for i, v in enumerate(calls): - #callManager.hangUp(v) - #return {'code':0,'error':""} -#add_to_suit("Place call",'Many simultanious calls (IP2IP)',stress_concurent_calls) - - -# Test if a call can be put and removed from hold multiple time -def stress_hold_unhold_server(): - # Hang up everything left - calls = callManager.getCallList() - for i, v in enumerate(calls): - callManager.hangUp(v) - - #Place a call - callManager.placeCall(first_account,first_account_number) - calls = callManager.getCallList() - if len(calls) < 1: - return {'code':5,'error':"\nUnit test \"stress_hold_unhold\" failed: The call is gone"} - call = calls[0] - - #Hold and unhold it - for i in range(0,10): - callManager.hold(call) - details = callManager.getCallDetails(call) - if not 'CALL_STATE' in details: - return {'code':1,'error':"\nUnit test \"stress_hold_unhold\" failed: The call is gone (hold)"} - if not details['CALL_STATE'] == "HOLD": - return {'code':2,'error':"\nUnit test \"stress_hold_unhold\" failed: The call should be on hold, but is "+details['CALL_STATE']} - callManager.unhold(call) - details = callManager.getCallDetails(call) - if not 'CALL_STATE' in details: - return {'code':3,'error':"\nUnit test \"stress_hold_unhold\" failed: The call is gone (unhold)"} - if not details['CALL_STATE'] == "CURRENT": - return {'code':4,'error':"\nUnit test \"stress_hold_unhold\" failed: The call should be current, but is "+details['CALL_STATE']} - return {'code':0,'error':""} -add_to_suit("Hold call",'Hold and unhold',stress_hold_unhold_server) - -#Run the tests -run() -#kate: space-indent off; tab-indents on; mixedindent off; indent-width 4;tab-width 4; diff --git a/test/sdesnegotiatortest.cpp b/test/sdesnegotiatortest.cpp deleted file mode 100644 index 82aa0337f14d1e99e0b1afa59ab2707c6ef0217f..0000000000000000000000000000000000000000 --- a/test/sdesnegotiatortest.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <cstddef> -#include <stdio.h> -#include <sstream> -#include <cstddef> -#include <string> -#include <cstring> -#include <math.h> -#include <dlfcn.h> -#include <iostream> -#include <sstream> - -#include "sdesnegotiatortest.h" -#include "sip/pattern.h" -#include "sip/sdes_negotiator.h" - -#include <unistd.h> -#include "test_utils.h" -#include "logger.h" - -namespace ring { namespace test { - -using std::cout; -using std::endl; - -void SdesNegotiatorTest::testTagPattern() -{ - TITLE(); - std::string subject = "a=crypto:4"; - - ring::Pattern pattern("^a=crypto:(?P<tag>[0-9]{1,9})", false); - pattern.updateSubject(subject); - - CPPUNIT_ASSERT(pattern.matches()); - CPPUNIT_ASSERT(pattern.group("tag").compare("4") == 0); -} - - -void SdesNegotiatorTest::testCryptoSuitePattern() -{ - TITLE(); - std::string subject = "AES_CM_128_HMAC_SHA1_80"; - - ring::Pattern pattern("(?P<cryptoSuite>AES_CM_128_HMAC_SHA1_80|" \ - "AES_CM_128_HMAC_SHA1_32|" \ - "F8_128_HMAC_SHA1_80|" \ - "[A-Za-z0-9_]+)", false); - pattern.updateSubject(subject); - - CPPUNIT_ASSERT(pattern.matches()); - CPPUNIT_ASSERT(pattern.group("cryptoSuite").compare("AES_CM_128_HMAC_SHA1_80") == 0); -} - - -void SdesNegotiatorTest::testKeyParamsPattern() -{ - TITLE(); - - std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32"; - - ring::Pattern pattern("(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ - "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)\\|" \ - "(2\\^(?P<lifetime>[0-9]+)\\|" \ - "(?P<mkiValue>[0-9]+)\\:" \ - "(?P<mkiLength>[0-9]{1,3})\\;?)?", true); - - pattern.updateSubject(subject); - - pattern.matches(); - CPPUNIT_ASSERT(pattern.group("srtpKeyMethod").compare("inline:")); - CPPUNIT_ASSERT(pattern.group("srtpKeyInfo").compare("d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj") - == 0); - CPPUNIT_ASSERT(pattern.group("lifetime").compare("20") == 0); - CPPUNIT_ASSERT(pattern.group("mkiValue").compare("1") == 0); - CPPUNIT_ASSERT(pattern.group("mkiLength").compare("32") == 0); -} - - -void SdesNegotiatorTest::testKeyParamsPatternWithoutMKI() -{ - TITLE(); - - std::string subject("inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj"); - - ring::Pattern pattern("(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ - "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)" \ - "(\\|2\\^(?P<lifetime>[0-9]+)\\|" \ - "(?P<mkiValue>[0-9]+)\\:" \ - "(?P<mkiLength>[0-9]{1,3})\\;?)?", true); - - pattern.updateSubject(subject); - pattern.matches(); - CPPUNIT_ASSERT(pattern.group("srtpKeyMethod").compare("inline:")); - CPPUNIT_ASSERT(pattern.group("srtpKeyInfo").compare("d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj") - == 0); -} - - -/** - * Make sure that all the fields can be extracted - * properly from the syntax. - */ -void SdesNegotiatorTest::testNegotiation() -{ - TITLE(); - - // Add a new SDES crypto line to be processed. - std::vector<std::string> remoteOffer; - remoteOffer.push_back("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd|2^20|1:32"); - remoteOffer.push_back("a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32"); - - // Register the local capabilities. - std::vector<ring::CryptoSuiteDefinition> localCapabilities; - - for (int i = 0; i < 3; ++i) - localCapabilities.push_back(ring::CryptoSuites[i]); - - ring::SdesNegotiator sdesnego(localCapabilities, remoteOffer); - - CPPUNIT_ASSERT(sdesnego.negotiate()); -} - -/** - * Make sure that unproperly formatted crypto lines are rejected. - */ -void SdesNegotiatorTest::testComponent() -{ - TITLE(); - - // Register the local capabilities. - std::vector<ring::CryptoSuiteDefinition> capabilities; - - // Support all the CryptoSuites - for (int i = 0; i < 3; i++) - capabilities.push_back(ring::CryptoSuites[i]); - - // Make sure that if a component is missing, negotiate will fail - std::string cryptoLine("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:|2^20|1:32"); - std::vector<std::string> cryptoOffer; - cryptoOffer.push_back(cryptoLine); - - ring::SdesNegotiator negotiator(capabilities, cryptoOffer); - CPPUNIT_ASSERT(!negotiator.negotiate()); -} - -/** - * Make sure that most simple case does not fail. - */ -void SdesNegotiatorTest::testMostSimpleCase() -{ - TITLE(); - - // Register the local capabilities. - std::vector<ring::CryptoSuiteDefinition> capabilities; - - // Support all the CryptoSuites - for (int i = 0; i < 3; i++) - capabilities.push_back(ring::CryptoSuites[i]); - - // Make sure taht this case works (since it's default for most application) - std::string cryptoLine("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd"); - std::vector<std::string> cryptoOffer; - cryptoOffer.push_back(cryptoLine); - - ring::SdesNegotiator negotiator(capabilities, cryptoOffer); - - CPPUNIT_ASSERT(negotiator.negotiate()); - - CPPUNIT_ASSERT(negotiator.getCryptoSuite() == "AES_CM_128_HMAC_SHA1_80"); - CPPUNIT_ASSERT(negotiator.getKeyMethod() == "inline"); - CPPUNIT_ASSERT(negotiator.getKeyInfo() == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd"); - CPPUNIT_ASSERT(negotiator.getLifeTime().empty()); - CPPUNIT_ASSERT(negotiator.getMkiValue().empty()); - CPPUNIT_ASSERT(negotiator.getMkiLength().empty()); - CPPUNIT_ASSERT(negotiator.getAuthTagLength() == "80"); -} - - -void SdesNegotiatorTest::test32ByteKeyLength() -{ - TITLE(); - - // Register the local capabilities. - std::vector<ring::CryptoSuiteDefinition> capabilities; - - //Support all the CryptoSuites - for (int i = 0; i < 3; i++) - capabilities.push_back(ring::CryptoSuites[i]); - - std::string cryptoLine("a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd"); - std::vector<std::string> cryptoOffer; - cryptoOffer.push_back(cryptoLine); - - ring::SdesNegotiator negotiator(capabilities, cryptoOffer); - - CPPUNIT_ASSERT(negotiator.negotiate()); - - CPPUNIT_ASSERT(negotiator.getCryptoSuite() == "AES_CM_128_HMAC_SHA1_32"); - CPPUNIT_ASSERT(negotiator.getKeyMethod() == "inline"); - CPPUNIT_ASSERT(negotiator.getKeyInfo() == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd"); - CPPUNIT_ASSERT(negotiator.getLifeTime().empty()); - CPPUNIT_ASSERT(negotiator.getMkiValue().empty()); - CPPUNIT_ASSERT(negotiator.getMkiLength().empty()); - CPPUNIT_ASSERT(negotiator.getAuthTagLength() == "32"); -} - -}} // namespace ring::test diff --git a/test/sdesnegotiatortest.h b/test/sdesnegotiatortest.h deleted file mode 100644 index 9eafa45d884e8cbf413964e55866a1bc0e1eca8a..0000000000000000000000000000000000000000 --- a/test/sdesnegotiatortest.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <cstddef> -#include <stdio.h> -#include <sstream> - -#include <vector> - -// pjsip import -#include <pjsip.h> -#include <pjlib.h> -#include <pjsip_ua.h> -#include <pjlib-util.h> -#include <pjnath/stun_config.h> - -#include "noncopyable.h" - -/* - * @file sdesnegotiationTest.cpp - * @brief Regroups unitary tests related to the plugin manager. - */ - -#ifndef __SDESNEGOTIATOR_TEST_H__ -#define __SDESNEGOTIATOR_TEST_H__ - -#include "sip/sdes_negotiator.h" // for CryptoSuiteDefinition - -namespace ring { namespace test { - -class Pattern; - -class SdesNegotiatorTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(SdesNegotiatorTest); - CPPUNIT_TEST(testTagPattern); - CPPUNIT_TEST(testCryptoSuitePattern); - CPPUNIT_TEST(testKeyParamsPattern); - CPPUNIT_TEST(testKeyParamsPatternWithoutMKI); - CPPUNIT_TEST(testNegotiation); - CPPUNIT_TEST(testMostSimpleCase); - CPPUNIT_TEST(test32ByteKeyLength); - CPPUNIT_TEST_SUITE_END(); - - public: - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - void testTagPattern(); - - void testCryptoSuitePattern(); - - void testKeyParamsPattern(); - - void testKeyParamsPatternCiscoStyle(); - - void testKeyParamsPatternWithoutMKI(); - - void testNegotiation(); - - void testComponent(); - - void testMostSimpleCase(); - - void test32ByteKeyLength(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SdesNegotiatorTest, "SdesNegotiatorTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(SdesNegotiatorTest); - -}} // namespace ring::test - -#endif // __SDESNEGOTIATOR_TEST_H__ diff --git a/test/sdptest.cpp b/test/sdptest.cpp deleted file mode 100644 index 5dd58023453d87d819bf2d1e7e4f667fbd6364e8..0000000000000000000000000000000000000000 --- a/test/sdptest.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * ebail - 2015/02/18 - * unit test is based on old SDP manager code - * this test is disabled for the moment - * */ -#if 0 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "sdptest.h" -#include <iostream> -#include <cstring> - -#include "audio/codecs/audiocodec.h" - -namespace ring { namespace test { - -enum session_type { - REMOTE_OFFER, - LOCAL_OFFER, -}; - -static const char *sdp_answer1 = "v=0\r\n" - "o=bob 2890844730 2890844730 IN IP4 host.example.com\r\n" - "s= \r\n" - "c=IN IP4 host.example.com\r\n" - "t=0 0\r\n" - "m=audio 49920 RTP/AVP 0\r\n" - "a=rtpmap:0 PCMU/8000\r\n" - "m=video 53002 RTP/AVP 32\r\n" - "a=rtpmap:32 MPV/90000\r\n"; - -static const char *sdp_offer1 = "v=0\r\n" - "o=bob 2890844730 2890844730 IN IP4 host.example.com\r\n" - "s= \r\n" - "c=IN IP4 host.example.com\r\n" - "t=0 0\r\n" - "m=audio 49920 RTP/AVP 0\r\n" - "a=rtpmap:0 PCMU/8000\r\n" - "m=video 53002 RTP/AVP 32\r\n" - "a=rtpmap:32 MPV/90000\r\n"; - -static const char *sdp_answer2 = "v=0\r\n" - "o=bob 2890844730 2890844730 IN IP4 host.example.com\r\n" - "s= \r\n" - "c=IN IP4 host.example.com\r\n" - "t=0 0\r\n" - "m=audio 49920 RTP/AVP 3 97 9\r\n" - "a=rtpmap:3 GSM/8000\r\n" - "a=rtpmap:97 iLBC/8000\r\n" - "a=rtpmap:9 G722/8000\r\n" - "m=video 53002 RTP/AVP 32\r\n" - "a=rtpmap:32 MPV/90000\r\n"; - -static const char *sdp_offer2 = "v=0\r\n" - "o=bob 2890844730 2890844730 IN IP4 host.example.com\r\n" - "s= \r\n" - "c=IN IP4 host.example.com\r\n" - "t=0 0\r\n" - "m=audio 49920 RTP/AVP 3 97 9\r\n" - "a=rtpmap:3 GSM/8000\r\n" - "a=rtpmap:97 iLBC/8000\r\n" - "a=rtpmap:9 G722/8000\r\n" - "m=video 53002 RTP/AVP 32\r\n" - "a=rtpmap:32 MPV/90000\r\n"; - -static const char *sdp_reinvite = "v=0\r\n" - "o=bob 2890844730 2890844730 IN IP4 host.example.com\r\n" - "s= \r\n" - "c=IN IP4 host.exampleReinvite.com\r\n" - "t=0 0\r\n" - "m=audio 42445 RTP/AVP 0\r\n" - "a=rtpmap:0 PCMU/8000\r\n" - "m=video 53002 RTP/AVP 32\r\n" - "a=rtpmap:32 MPV/90000\r\n"; - -static const char *const LOCALHOST = "127.0.0.1"; - -void SDPTest::setUp() -{ - session_.reset(new Sdp("123456789")); -} - -void SDPTest::tearDown() -{ - session_.reset(); -} - -void SDPTest::receiveAnswerAfterInitialOffer(const pjmedia_sdp_session* remote) -{ - CPPUNIT_ASSERT(pjmedia_sdp_neg_get_state(session_->negotiator_) == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER); - CPPUNIT_ASSERT(pjmedia_sdp_neg_set_remote_answer(session_->memPool_.get(), session_->negotiator_, remote) == PJ_SUCCESS); - CPPUNIT_ASSERT(pjmedia_sdp_neg_get_state(session_->negotiator_) == PJMEDIA_SDP_NEG_STATE_WAIT_NEGO); -} - -namespace { -std::vector<std::map<std::string, std::string> > - createVideoCodecs() { - std::vector<std::map<std::string, std::string> > videoCodecs; -#ifdef RING_VIDEO - std::map<std::string, std::string> codec; - codec["name"] = "H264"; - codec["enabled"] = "true"; - videoCodecs.push_back(codec); - codec["name"] = "H263"; - videoCodecs.push_back(codec); -#endif - return videoCodecs; - } -} - -void SDPTest::testInitialOfferFirstCodec() -{ - std::cout << "------------ SDPTest::testInitialOfferFirstCodec --------------" << std::endl; - - CPPUNIT_ASSERT(session_->getPublishedIP().empty()); - CPPUNIT_ASSERT(session_->getRemoteIP().empty()); - - std::vector<int> codecSelection; - - codecSelection.push_back(PAYLOAD_CODEC_ULAW); - codecSelection.push_back(PAYLOAD_CODEC_ALAW); - codecSelection.push_back(PAYLOAD_CODEC_G722); - - std::vector<std::map<std::string, std::string> > videoCodecs(createVideoCodecs()); - - session_->setPublishedIP(LOCALHOST); - session_->setLocalPublishedAudioPort(49567); - - session_->createOffer(codecSelection, videoCodecs); - - pjmedia_sdp_session *remoteAnswer; - pjmedia_sdp_parse(session_->memPool_.get(), (char*) sdp_answer1, strlen(sdp_answer1), &remoteAnswer); - - receiveAnswerAfterInitialOffer(remoteAnswer); - session_->startNegotiation(); - - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getPublishedIP() == LOCALHOST); - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); -} - -void SDPTest::testInitialAnswerFirstCodec() -{ - std::cout << "------------ SDPTest::testInitialAnswerFirstCodec -------------" << std::endl; - - CPPUNIT_ASSERT(session_->getPublishedIP().empty()); - CPPUNIT_ASSERT(session_->getRemoteIP().empty()); - - std::vector<int> codecSelection; - pjmedia_sdp_session *remoteOffer; - - codecSelection.push_back(PAYLOAD_CODEC_ULAW); - codecSelection.push_back(PAYLOAD_CODEC_ALAW); - codecSelection.push_back(PAYLOAD_CODEC_G722); - - pjmedia_sdp_parse(session_->memPool_.get(), (char*) sdp_offer1, strlen(sdp_offer1), &remoteOffer); - - session_->setPublishedIP(LOCALHOST); - session_->setLocalPublishedAudioPort(49567); - - session_->receiveOffer(remoteOffer, codecSelection, createVideoCodecs()); - - session_->startNegotiation(); - - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getPublishedIP() == LOCALHOST); - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); -} - -void SDPTest::testInitialOfferLastCodec() -{ - std::cout << "------------ SDPTest::testInitialOfferLastCodec --------------------" << std::endl; - - CPPUNIT_ASSERT(session_->getPublishedIP().empty()); - CPPUNIT_ASSERT(session_->getRemoteIP().empty()); - - std::vector<int> codecSelection; - - codecSelection.push_back(PAYLOAD_CODEC_ULAW); - codecSelection.push_back(PAYLOAD_CODEC_ALAW); - codecSelection.push_back(PAYLOAD_CODEC_G722); - - session_->setPublishedIP(LOCALHOST); - session_->setLocalPublishedAudioPort(49567); - - session_->createOffer(codecSelection, createVideoCodecs()); - - pjmedia_sdp_session *remoteAnswer; - pjmedia_sdp_parse(session_->memPool_.get(), (char*) sdp_answer2, strlen(sdp_answer2), &remoteAnswer); - - receiveAnswerAfterInitialOffer(remoteAnswer); - session_->startNegotiation(); - - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getPublishedIP() == LOCALHOST); - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); -} - -void SDPTest::testInitialAnswerLastCodec() -{ - std::cout << "------------ SDPTest::testInitialAnswerLastCodec ------------" << std::endl; - - CPPUNIT_ASSERT(session_->getPublishedIP().empty()); - CPPUNIT_ASSERT(session_->getRemoteIP().empty()); - - std::vector<int> codecSelection; - pjmedia_sdp_session *remoteOffer; - - codecSelection.push_back(PAYLOAD_CODEC_ULAW); - codecSelection.push_back(PAYLOAD_CODEC_ALAW); - codecSelection.push_back(PAYLOAD_CODEC_G722); - - pjmedia_sdp_parse(session_->memPool_.get(), (char*)sdp_offer2, strlen(sdp_offer2), &remoteOffer); - - session_->setPublishedIP(LOCALHOST); - session_->setLocalPublishedAudioPort(49567); - - session_->receiveOffer(remoteOffer, codecSelection, createVideoCodecs()); - - session_->startNegotiation(); - - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getPublishedIP() == LOCALHOST); - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); -} - - -void SDPTest::testReinvite() -{ - std::cout << "------------ SDPTest::testReinvite --------------------" << std::endl; - - CPPUNIT_ASSERT(session_->getPublishedIP().empty()); - CPPUNIT_ASSERT(session_->getRemoteIP().empty()); - - std::vector<int> codecSelection; - codecSelection.push_back(PAYLOAD_CODEC_ULAW); - codecSelection.push_back(PAYLOAD_CODEC_ALAW); - codecSelection.push_back(PAYLOAD_CODEC_G722); - - session_->setPublishedIP(LOCALHOST); - session_->setLocalPublishedAudioPort(49567); - - std::vector<std::map<std::string, std::string> > videoCodecs(createVideoCodecs()); - session_->createOffer(codecSelection, videoCodecs); - - pjmedia_sdp_session *remoteAnswer; - // pjmedia_sdp_parse(session_->memPool_.get(), test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); - pjmedia_sdp_parse(session_->memPool_.get(), (char*) sdp_answer1, strlen(sdp_answer1), &remoteAnswer); - - receiveAnswerAfterInitialOffer(remoteAnswer); - session_->startNegotiation(); - - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getPublishedIP() == LOCALHOST); - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); - std::vector<ring::AudioCodec*> codecs(session_->getSessionAudioMedia()); - ring::AudioCodec *codec = codecs[0]; - CPPUNIT_ASSERT(codec and codec->getMimeSubtype() == "PCMU"); - - pjmedia_sdp_session *reinviteOffer; - pjmedia_sdp_parse(session_->memPool_.get(), (char*) sdp_reinvite, strlen(sdp_reinvite), &reinviteOffer); - session_->receiveOffer(reinviteOffer, codecSelection, videoCodecs); - - session_->startNegotiation(); - session_->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(session_->getRemoteIP() == "host.exampleReinvite.com"); -} - -}} // namespace ring::test -#endif diff --git a/test/sdptest.h b/test/sdptest.h deleted file mode 100644 index fd36a935ba9bce92c36bf3b78776bd54ec4e6087..0000000000000000000000000000000000000000 --- a/test/sdptest.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * @file sdptest.h - * @brief Regroups unitary tests related to the SDP session - */ - -#ifndef _SDP_TEST_ -#define _SDP_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <exception> -#include <string> -#include <memory> - -#include <pj/pool.h> -#include <pjmedia/sdp.h> -#include <pjmedia/sdp_neg.h> -#include <pjmedia/errno.h> -#include <pjsip/sip_transport.h> -#include <pjlib.h> -#include <pjsip_ua.h> - -#include "sip/sdp.h" -#include "noncopyable.h" - -namespace ring { namespace test { -/* - * ebail - 2015/02/18 - * unit test is based on old SDP manager code - * this test is disabled for the moment - * */ -#if 0 - -class SdpSessionException : public std::exception { - public: - SdpSessionException(const std::string& str="") throw() : errstr(str) {} - - virtual ~SdpSessionException() throw() {} - - virtual const char *what() const throw() { - std::string expt("SdpSession: SdpSessionException occurred: "); - expt.append(errstr); - return expt.c_str(); - } - private: - std::string errstr; -}; - - -class SDPTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(SDPTest); - CPPUNIT_TEST(testInitialOfferLastCodec); - CPPUNIT_TEST(testInitialAnswerLastCodec); - CPPUNIT_TEST(testInitialOfferLastCodec); - CPPUNIT_TEST(testInitialAnswerLastCodec); - CPPUNIT_TEST(testReinvite); - CPPUNIT_TEST_SUITE_END(); - - public: - SDPTest() : CppUnit::TestCase("SDP module Tests") {} - - /** - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /** - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - void tearDown(); - - void testInitialOfferFirstCodec(); - - void testInitialAnswerFirstCodec(); - - void testInitialOfferLastCodec(); - - void testInitialAnswerLastCodec(); - - void testReinvite(); - - private: - NON_COPYABLE(SDPTest); - void receiveAnswerAfterInitialOffer(const pjmedia_sdp_session* remote); - - std::unique_ptr<Sdp> session_; -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SDPTest, "SDPTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(SDPTest); - -}} // namespace ring::test - -#endif -#endif //_SDP_TEST_ diff --git a/test/sippxml/test_1.xml b/test/sippxml/test_1.xml deleted file mode 100644 index 709263935701cf94a8c6ceba041d29bb7a544c2c..0000000000000000000000000000000000000000 --- a/test/sippxml/test_1.xml +++ /dev/null @@ -1,157 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> -<!-- --> -<!-- Sipp default 'uas' scenario. --> -<!-- --> - -<scenario name="UAS responder put on hold then hungup"> - - <!-- This scenario implies a second call made by the uac which implies --> - <!-- This call to be put on hold automatically --> - - <recv request="INVITE" crlf="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - - <!-- Here process a second invite with updated sdp, this call is placed on HOLD --> - <!-- TODO: parse in sdp: Media Attribute (a): sendonly --> - <recv request="INVITE" crlf="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 100 Trying - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <!-- expect to be hung up immediately --> - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <!-- Keep the call open for a while in case the 200 is lost to be --> - <!-- able to retransmit it if we receive the BYE again. --> - <timewait milliseconds="4000"/> - - - <!-- definition of the response time repartition table (unit is ms) --> - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <!-- definition of the call length repartition table (unit is ms) --> - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> - diff --git a/test/sippxml/test_2.xml b/test/sippxml/test_2.xml deleted file mode 100644 index fa3b9c129ec9ee4cce50d58bfb9446caa089b804..0000000000000000000000000000000000000000 --- a/test/sippxml/test_2.xml +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> -<!-- --> -<!-- Sipp default 'uac' scenario. --> -<!-- --> - -<scenario name="Two simultaneous outgoing call Sipstone UAC"> - <!-- In client mode (sipp placing calls), the Call-ID MUST be --> - <!-- generated by sipp. To do so, use [call_id] keyword. --> - <send retrans="500"> - <![CDATA[ - - INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" optional="true"> - </recv> - - <recv response="180" optional="true"> - </recv> - - <recv response="183" optional="true"> - </recv> - - <!-- By adding rrs="true" (Record Route Sets), the route sets --> - <!-- are saved and used for following messages sent. Useful to test --> - <!-- against stateful SIP proxies/B2BUAs. --> - <recv response="200" rtd="true"> - </recv> - - <!-- Packet lost can be simulated in any send/recv message by --> - <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> - <send> - <![CDATA[ - - ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 1 ACK - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <!-- Here is where the call is put on hold --> - <recv request="INVITE" crlf="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 100 Trying - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - rtd="true" - crlf="true"> - </recv> - - <!-- The 'crlf' option inserts a blank line in the statistics report. --> - <send retrans="500"> - <![CDATA[ - - BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 2 BYE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200" crlf="true"> - </recv> - - <!-- definition of the response time repartition table (unit is ms) --> - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <!-- definition of the call length repartition table (unit is ms) --> - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> - diff --git a/test/sippxml/test_3.xml b/test/sippxml/test_3.xml deleted file mode 100644 index bae7eaa2bc795eafd357f3ca30e18433c1220a2e..0000000000000000000000000000000000000000 --- a/test/sippxml/test_3.xml +++ /dev/null @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="UAS HOLD/OFFHOLD"> - - <!-- Receive a new call --> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="1"/> - <log message="Media is [$1]"/> - </action> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> -</send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- This call is now on HOLD: sendonly tell to PBX to send music on hold--> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendonly" search_in="body" check_it="true" assign_to="2"/> - <log message="Media is [$2]"/> - </action> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- OFFHOLD this call --> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="3"/> - <log message="Media is [$3]"/> - </action> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- Hangup this call --> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <pause milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/test/sippxml/test_4.xml b/test/sippxml/test_4.xml deleted file mode 100644 index d241bfe3b6a33860adcfc6eef34ca1e7886c16c5..0000000000000000000000000000000000000000 --- a/test/sippxml/test_4.xml +++ /dev/null @@ -1,122 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> -<!-- --> -<!-- Sipp default 'uac' scenario. --> -<!-- --> - -<scenario name="Basic Sipstone UAC"> - <!-- In client mode (sipp placing calls), the Call-ID MUST be --> - <!-- generated by sipp. To do so, use [call_id] keyword. -- - <send retrans="500"> - <![CDATA[ - - INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" - optional="true"> - </recv> - - <recv response="180" optional="true"> - </recv> - - <recv response="183" optional="true"> - </recv> - - <!-- By adding rrs="true" (Record Route Sets), the route sets --> - <!-- are saved and used for following messages sent. Useful to test --> - <!-- against stateful SIP proxies/B2BUAs. --> - <recv response="200" rtd="true"> - <action> - <ereg regexp="a=rtpmap:0 PCMU/8000" search_in="body" check_it="true" assign_to="1" /> - <log message="Custom header is [$1]"/> - </action> - </recv> - - <!-- Packet lost can be simulated in any send/recv message by --> - <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> - <send> - <![CDATA[ - - ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 1 ACK - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <!-- This delay can be customized by the -d command-line option --> - <!-- or by adding a 'milliseconds = "value"' option here. --> - <pause/> - - <!-- The 'crlf' option inserts a blank line in the statistics report. --> - <send retrans="500"> - <![CDATA[ - - BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 2 BYE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200" crlf="true"> - </recv> - - <!-- definition of the response time repartition table (unit is ms) --> - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <!-- definition of the call length repartition table (unit is ms) --> - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> - diff --git a/test/siptest.cpp b/test/siptest.cpp deleted file mode 100644 index c3a40785332ceeab58f21b337283cf523132546d..0000000000000000000000000000000000000000 --- a/test/siptest.cpp +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * ebail - 2015/02/18 - * unit test is deprecated - * this test is disabled for the moment - * */ -#if 0 - -#include <unistd.h> -#include <cstdlib> -#include <cstdio> -#include <iostream> -#include <fstream> - -#include <pthread.h> -#include <string> - -#include "siptest.h" -#include "manager.h" -#include "sip/sipvoiplink.h" -#include "sip/sip_utils.h" -#include "sip/sipcall.h" - -// anonymous namespace -namespace { -pthread_mutex_t count_mutex; -pthread_cond_t count_nb_thread; -int counter = 0; -} - -namespace ring { namespace test { - -void *sippThreadWithCount(void *str) -{ - pthread_mutex_lock(&count_mutex); - counter++; - pthread_mutex_unlock(&count_mutex); - - std::string *command = (std::string *)(str); - - std::cout << "SIPTest: " << command << std::endl; - - // Set up the sipp instance in this thread in order to catch return value - // 0: All calls were successful - // 1: At least one call failed - // 97: exit on internal command. Calls may have been processed - // 99: Normal exit without calls processed - // -1: Fatal error - // -2: Fatal error binding a socket - int i = system(command->c_str()); - - CPPUNIT_ASSERT(i); - - pthread_mutex_lock(&count_mutex); - counter--; - - if (counter == 0) - pthread_cond_signal(&count_nb_thread); - - pthread_mutex_unlock(&count_mutex); - - pthread_exit(NULL); -} - - -void *sippThread(void *str) -{ - std::string *command = static_cast<std::string *>(str); - std::cout << "SIPTest: " << command << std::endl; - - // Set up the sipp instance in this thread in order to catch return value - // 0: All calls were successful - // 1: At least one call failed - // 97: exit on internal command. Calls may have been processed - // 99: Normal exit without calls processed - // -1: Fatal error - // -2: Fatal error binding a socket - int i = system(command->c_str()); - - std::stringstream output; - output << i; - - std::cout << "SIPTest: Command executed by system returned: " << output.str() << std::endl; - pthread_exit(NULL); -} - - -void SIPTest::setUp() -{ - pthread_mutex_lock(&count_mutex); - counter = 0; - pthread_mutex_unlock(&count_mutex); -} - -void SIPTest::tearDown() -{ - // in order to stop any currently running threads - std::cout << "SIPTest: Clean all remaining sipp instances" << std::endl; - int ret = system("killall sipp"); - - if (!ret) - std::cout << "SIPTest: Error from system call, killall sipp" << std::endl; -} - - -void SIPTest::testSimpleOutgoingIpCall() -{ - pthread_t thethread; - - // command to be executed by the thread, user agent server waiting for a call - std::string command("sipp -sn uas -i 127.0.0.1 -p 5068 -m 1 -bg"); - - int rc = pthread_create(&thethread, NULL, sippThread, &command); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - std::string testaccount("IP2IP"); - std::string testcallid("callid1234"); - std::string testcallnumber("sip:test@127.0.0.1:5068"); - - CPPUNIT_ASSERT(!Manager::instance().hasCurrentCall()); - - // start a new call sending INVITE message to sipp instance - Manager::instance().outgoingCall(testaccount, testcallid, testcallnumber); - - // must sleep here until receiving 180 and 200 message from peer - sleep(2); - - CPPUNIT_ASSERT(Manager::instance().hasCurrentCall()); - CPPUNIT_ASSERT(Manager::instance().getCurrentCallId() == testcallid); - - Manager::instance().hangupCall(testcallid); - - rc = pthread_join(thethread, NULL); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_join(): " << rc << std::endl; - else - std::cout << "SIPTest: completed join with thread" << std::endl; -} - - -void SIPTest::testSimpleIncomingIpCall() -{ - pthread_t thethread; - - // command to be executed by the thread, user agent client which initiate a call and hangup - std::string command("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1i -bg"); - - int rc = pthread_create(&thethread, NULL, sippThread, &command); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - // sleep a while to make sure that sipp insdtance is initialized and dring received - // the incoming invite. - sleep(2); - - CPPUNIT_ASSERT(Manager::instance().callFactory.callCount<SIPCall>() == 1); - - // Answer this call - const auto& calls = Manager::instance().callFactory.getAllCalls<SIPCall>(); - const auto call = *calls.cbegin(); - CPPUNIT_ASSERT(Manager::instance().answerCall(call->getCallId())); - - sleep(1); - - rc = pthread_join(thethread, NULL); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_join(): " << rc << std::endl; - else - std::cout << "SIPTest: completed join with thread" << std::endl; -} - - -void SIPTest::testTwoOutgoingIpCall() -{ - // This scenario expect to be put on hold before hangup - std::string firstCallCommand("sipp -sf tools/sippxml/test_1.xml -i 127.0.0.1 -p 5062 -m 1"); - - // The second call uses the default user agent scenario - std::string secondCallCommand("sipp -sn uas -i 127.0.0.1 -p 5064 -m 1"); - - pthread_t firstCallThread; - int rc = pthread_create(&firstCallThread, NULL, sippThread, &firstCallCommand); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - pthread_t secondCallThread; - rc = pthread_create(&secondCallThread, NULL, sippThread, &secondCallCommand); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - sleep(1); - - std::string testAccount("IP2IP"); - - std::string firstCallID("callid1234"); - std::string firstCallNumber("sip:test@127.0.0.1:5062"); - - std::string secondCallID("callid2345"); - std::string secondCallNumber("sip:test@127.0.0.1:5064"); - - CPPUNIT_ASSERT(!Manager::instance().hasCurrentCall()); - - // start a new call sending INVITE message to sipp instance - // this call should be put on hold when making the second call - Manager::instance().outgoingCall(testAccount, firstCallID, firstCallNumber); - - // must sleep here until receiving 180 and 200 message from peer - sleep(1); - - Manager::instance().outgoingCall(testAccount, secondCallID, secondCallNumber); - - sleep(1); - - Manager::instance().hangupCall(firstCallID); - - rc = pthread_join(firstCallThread, NULL); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_join(): " << rc << std::endl; - - std::cout << "SIPTest: completed join with thread" << std::endl; - - Manager::instance().hangupCall(secondCallID); - - rc = pthread_join(secondCallThread, NULL); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_join(): " << rc << std::endl; - else - std::cout << "SIPTest: completed join with thread" << std::endl; -} - -void SIPTest::testTwoIncomingIpCall() -{ - pthread_mutex_init(&count_mutex, NULL); - pthread_cond_init(&count_nb_thread, NULL); - - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - - // the first call is supposed to be put on hold when answering teh second incoming call - std::string firstCallCommand("sipp -sf tools/sippxml/test_2.xml 127.0.0.1 -i 127.0.0.1 -p 5064 -m 1 > testfile1.txt -bg"); - - // command to be executed by the thread, user agent client which initiate a call and hangup - std::string secondCallCommand("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1 -d 250 > testfile2.txt -bg"); - - pthread_t firstCallThread; - int rc = pthread_create(&firstCallThread, &attr, sippThreadWithCount, &firstCallCommand); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - // sleep a while to make sure that sipp insdtance is initialized and dring received - // the incoming invite. - sleep(1); - - CPPUNIT_ASSERT(Manager::instance().callFactory.callCount<SIPCall>() == 1); - - // Answer this call - auto calls = Manager::instance().callFactory.getCallIDs<SIPCall>(); - auto iterCallId = calls.cbegin(); - const auto& firstCallId = *iterCallId; - CPPUNIT_ASSERT(Manager::instance().answerCall(firstCallId)); - - sleep(1); - pthread_t secondCallThread; - rc = pthread_create(&secondCallThread, &attr, sippThread, &secondCallCommand); - - if (rc) - std::cout << "SIPTest: Error; return code from pthread_create()" << std::endl; - - sleep(1); - - CPPUNIT_ASSERT(Manager::instance().callFactory.callCount<SIPCall>() == 2); - calls = Manager::instance().callFactory.getCallIDs<SIPCall>(); - iterCallId = calls.cbegin(); - if (*iterCallId == firstCallId) - ++iterCallId; - - std::string secondCallID(*iterCallId); - - CPPUNIT_ASSERT(Manager::instance().answerCall(secondCallID)); - - sleep(2); - - pthread_mutex_lock(&count_mutex); - - while (counter > 0) - pthread_cond_wait(&count_nb_thread, &count_mutex); - - pthread_mutex_unlock(&count_mutex); - - pthread_mutex_destroy(&count_mutex); - pthread_cond_destroy(&count_nb_thread); -} - - -void SIPTest::testHoldIpCall() -{ - std::string callCommand("sipp -sf tools/sippxml/test_3.xml -i 127.0.0.1 -p 5062 -m 1 -bg"); - - pthread_t callThread; - int rc = pthread_create(&callThread, NULL, sippThread, (void *)(&callCommand)); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create(): " << rc << std::endl; - else - std::cout << "SIPTest: completed thread creation" << std::endl; - - - std::string testAccount("IP2IP"); - - std::string testCallID("callid1234"); - std::string testCallNumber("sip:test@127.0.0.1:5062"); - - Manager::instance().outgoingCall(testAccount, testCallID, testCallNumber); - - sleep(1); - - Manager::instance().onHoldCall(testCallID); - - sleep(1); - - Manager::instance().offHoldCall(testCallID); - - sleep(1); - - Manager::instance().hangupCall(testCallID); -} - -void SIPTest::testSIPURI() -{ - std::string foo("<sip:17771234567@callcentric.com>"); - sip_utils::stripSipUriPrefix(foo); - CPPUNIT_ASSERT(foo == "17771234567"); -} - -void SIPTest::testParseDisplayName() -{ - // 1st element is input, 2nd is expected output - const char *test_set[][2] = { - {"\nFrom: \"A. G. Bell\" <sip:agb@bell-telephone.com> ;tag=a48s", "A. G. Bell"}, - {"\nFrom: \"A. G. Bell2\" <sip:agb@bell-telephone.com> ;tag=a48s\r\nOtherLine: \"bla\"\r\n", "A. G. Bell2"}, - {"\nf: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8", "Anonymous"}, - {"\nFrom: \"Alejandro Perez\" <sip:1111@10.0.0.1>;tag=3a7516a63bdbo0", "Alejandro Perez"}, - {"\nFrom: \"Malformed <sip:1111@10.0.0.1>;tag=3a6a63bdbo0", ""}, - {"\nTo: <sip:1955@10.0.0.1>;tag=as6fbade41", ""}, - {"\nFrom: \"1000\" <sip:1000@sip.example.es>;tag=as775338f3", "1000"}, - {"\nFrom: 1111_9532323 <sip:1111_9532323@sip.example.es>;tag=caa3a61", "1111_9532323"}, - {"\nFrom: \"4444_953111111\" <sip:4444_111111@sip.example.es>;tag=2b00632co0", "4444_953111111"}, - {"\nFrom: <sip:6926666@4.4.4.4>;tag=4421-D9700", ""}, - {"\nFrom: <sip:pinger@sipwise.local>;tag=01f516a4", ""}, - {"\nFrom: sip:pinger@sipwise.local;tag=01f516a4", ""}, - {"\nFrom: ", ""}, - {"\nFrom: \"\xb1""Alejandro P\xc3\xa9rez\" <sip:1111@10.0.0.1>;tag=3a7516a63bdbo0", "\xef\xbf\xbd""Alejandro P\xc3\xa9rez"}, - {"\nFrom: \"Alejandro P\xc3\xa9rez\" <sip:1111@10.0.0.1>;tag=3a7516a63bdbo0", "Alejandro P\xc3\xa9rez"}, - {"\nFrom: sip:+1212555@server.example.com;tag=887s", ""}}; - - for (const auto &t : test_set) { - const std::string str(sip_utils::parseDisplayName(t[0])); - CPPUNIT_ASSERT_MESSAGE(std::string("\"") + str + "\" should be \"" + - t[1] + "\", input on next line: " + t[0], - str == t[1]); - } -} - -void SIPTest::testIncomingIpCallSdp() -{ - // command to be executed by the thread, user agent client which initiate a call and hangup - std::string command("sipp -sf tools/sippxml/test_4.xml 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1i -bg"); - - pthread_t thethread; - int rc = pthread_create(&thethread, NULL, sippThread, (void *)(&command)); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_create()" << std::endl; - - // sleep a while to make sure that sipp insdtance is initialized and dring received - // the incoming invite. - sleep(2); - - CPPUNIT_ASSERT(Manager::instance().callFactory.callCount<SIPCall>() == 1); - - // Answer this call - const auto& calls = Manager::instance().callFactory.getAllCalls<SIPCall>(); - - // TODO: hmmm, should IP2IP call be stored in call list.... - CPPUNIT_ASSERT(Manager::instance().getCallList().empty()); - - // Answer this call - CPPUNIT_ASSERT(Manager::instance().answerCall((*calls.cbegin())->getCallId())); - - sleep(1); - - rc = pthread_join(thethread, NULL); - - if (rc) - std::cout << "SIPTest: RING_ERR; return code from pthread_join(): " << rc << std::endl; - else - std::cout << "SIPTest: completed join with thread" << std::endl; -} - -}} // namespace ring::test -#endif diff --git a/test/siptest.h b/test/siptest.h deleted file mode 100644 index 25018ea94a0c08a5dea53bcfb7c628d0da783415..0000000000000000000000000000000000000000 --- a/test/siptest.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -// Application import -#include "manager.h" - -/* - * @file siptest.h - * @brief Regroups unitary tests related to the SIP module - */ - -#ifndef _SIP_TEST_ -#define _SIP_TEST_ - -namespace ring { namespace test { - -class SIPTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(SIPTest); - CPPUNIT_TEST ( testSimpleOutgoingIpCall ); - CPPUNIT_TEST ( testParseDisplayName ); - // CPPUNIT_TEST ( testSimpleIncomingIpCall ); - // CPPUNIT_TEST ( testTwoOutgoingIpCall ); - // CPPUNIT_TEST ( testTwoIncomingIpCall ); - // CPPUNIT_TEST ( testHoldIpCall); - // CPPUNIT_TEST ( testIncomingIpCallSdp ); - CPPUNIT_TEST_SUITE_END(); - - public: - SIPTest() : CppUnit::TestCase("SIP module Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - void tearDown(); - - - void testSimpleOutgoingIpCall(void); - - void testSimpleIncomingIpCall(void); - - void testTwoOutgoingIpCall(void); - - void testTwoIncomingIpCall(void); - - void testHoldIpCall(void); - - void testIncomingIpCallSdp(void); - - void testSIPURI(); - - void testParseDisplayName(); -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SIPTest, "SIPTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(SIPTest); - -}} // namespace ring::test - -#endif diff --git a/test/test_utils.h b/test/test_utils.h deleted file mode 100644 index 52289acbd01166072c2f9a55e2565cb036e39be9..0000000000000000000000000000000000000000 --- a/test/test_utils.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef TEST_UTILS_H_ -#define TEST_UTILS_H_ - -#include "logger.h" - -#define TITLE() RING_DBG("Starting test..."); fflush(stderr) - -#endif // TEST_UTILS_H_ diff --git a/test/tlsSample/ca.crt b/test/tlsSample/ca.crt deleted file mode 100644 index 5f5b49060669485e0c08f3d180346d223657ac26..0000000000000000000000000000000000000000 --- a/test/tlsSample/ca.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDtzCCAm+gAwIBAgIEU3EhUTANBgkqhkiG9w0BAQsFADBLMQswCQYDVQQGEwJD -QTEYMBYGA1UEChMPU2F2b2lyRmFpcmVUZXN0MREwDwYDVQQHEwhNb250cmVhbDEP -MA0GA1UECBMGUXVlYmVjMB4XDTE0MDUxMjE5MzAyOVoXDTE1MDUxMjE5MzAzM1ow -SzELMAkGA1UEBhMCQ0ExGDAWBgNVBAoTD1Nhdm9pckZhaXJlVGVzdDERMA8GA1UE -BxMITW9udHJlYWwxDzANBgNVBAgTBlF1ZWJlYzCCAVIwDQYJKoZIhvcNAQEBBQAD -ggE/ADCCAToCggExAKOMxKvsloBIWBNVTvMXTnvmXoCvSJpH0FNjJnFySUY9x7ld -p/oWdVU7SJQn1u1nKwuP27NWLX3ICRZo2ziRbBNfI0DaUcNX+sg/G2Ftzr5Z86oP -n4LOTuAaRrAHELTJafGnFdl7v5t3OAElRy7ICkQhmqdPJndvOaAREmyZXIkbn+bF -zO369/UBRF26Z9sYwwV65bZZ6eHw2wTuHXyDLKA+Qcj7HMhE4Zu1ySFtjDZYo6OD -ygPZDyOiftm+o8noZyMaLI+r3KY0W14QnGnLSSLVE+CbVErBU+lZ7LjODpn8bsa7 -hOV74r0xRux2VrWfDpIVulpm+gDxKQK1eTR7ENJKPBsfcDCblflVZHoY87TYckWW -98zGRdehSSoJhJotexIecrybZW6T3QycsbeALnECAwEAAaNDMEEwDwYDVR0TAQH/ -BAUwAwEB/zAPBgNVHQ8BAf8EBQMDBwQAMB0GA1UdDgQWBBQeTMJ8HtoXRp316pus -7AMDEDq8CDANBgkqhkiG9w0BAQsFAAOCATEAWRKyaKLC7VRVshITdvsMoleV+5ek -xH3riJmw/x1Peosu2ijehEUc+cHFRA0/wFyY93YzsmVyR6lrdL3f8KOD+k6u/s0z -hhAoYoVeZTwZ7wGN2yz8oVUcM/NlVA//DTqU/RYjm19cLKR4YIWglbPmWHNh/rI8 -vOi2IbhubsXXCgi0lL3G7Lz8//sEkxlhh3y9j1dmygtIL8rX8GlJsLZPbGELQrQF -8mHuIfMMOFMXqV9Os2gStKYpNh/to2fdE5elxGjegluDJ6wXH3Wsoth35j7woaRj -HZ2SovMUz7IPklsk1QNaRb08LxJUHVpJffsRIpJMvUFl7nxWIT/ZEaV3aY4lc0ks -PL0i952R2ddVR7O0g7hkuYT72lVE+Vw9+HrEdWDkOSnBxvKSTn7zjzmnGA== ------END CERTIFICATE----- diff --git a/test/tlsSample/cert.crt b/test/tlsSample/cert.crt deleted file mode 100644 index 7697f260827bf56c92992ee92fcc6061430ba923..0000000000000000000000000000000000000000 --- a/test/tlsSample/cert.crt +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDyzCCAoOgAwIBAgIEU3EusDANBgkqhkiG9w0BAQsFADBLMQswCQYDVQQGEwJD -QTEYMBYGA1UEChMPU2F2b2lyRmFpcmVUZXN0MREwDwYDVQQHEwhNb250cmVhbDEP -MA0GA1UECBMGUXVlYmVjMB4XDTE0MDUxMjIwMjcyOFoXDTE1MDUxMjIwMjczMVow -UjELMAkGA1UEBhMCQ0ExHzAdBgNVBAoTFlNhdm9pckZhaXJlQ2VydGlmaWNhdGUx -ETAPBgNVBAcTCE1vbnRyZWFsMQ8wDQYDVQQIEwZRdWViZWMwggFSMA0GCSqGSIb3 -DQEBAQUAA4IBPwAwggE6AoIBMQCjjMSr7JaASFgTVU7zF0575l6Ar0iaR9BTYyZx -cklGPce5Xaf6FnVVO0iUJ9btZysLj9uzVi19yAkWaNs4kWwTXyNA2lHDV/rIPxth -bc6+WfOqD5+Czk7gGkawBxC0yWnxpxXZe7+bdzgBJUcuyApEIZqnTyZ3bzmgERJs -mVyJG5/mxczt+vf1AURdumfbGMMFeuW2Wenh8NsE7h18gyygPkHI+xzIROGbtckh -bYw2WKOjg8oD2Q8jon7ZvqPJ6GcjGiyPq9ymNFteEJxpy0ki1RPgm1RKwVPpWey4 -zg6Z/G7Gu4Tle+K9MUbsdla1nw6SFbpaZvoA8SkCtXk0exDSSjwbH3Awm5X5VWR6 -GPO02HJFlvfMxkXXoUkqCYSaLXsSHnK8m2Vuk90MnLG3gC5xAgMBAAGjUDBOMAwG -A1UdEwEB/wQCMAAwHQYDVR0OBBYEFB5Mwnwe2hdGnfXqm6zsAwMQOrwIMB8GA1Ud -IwQYMBaAFB5Mwnwe2hdGnfXqm6zsAwMQOrwIMA0GCSqGSIb3DQEBCwUAA4IBMQAP -W4x5JU7vBBWgJdpqy5YMr9yu9HICwrUpUC4uq7GmhFs91mJpSAu1MIb9c1Iy4XBX -cJV65R30NIJY+tBxxss+DP458UwSjBHRs2aFsBMkJOpzXmjlUl3QifoLCbLtPYv0 -Q741zCU5k9c2qzSNoEfxoKugP2J31aVNsfl4NMxuC7xsrXGtuJK3yp8MIIXdFTq8 -lTrSZ1nltQxdU/Tg8nlKT1ikzew9cI6BmPyWXzHoVaP6PJruYUZsVyGX+408JFvO -tqyY6XiSn4jpTgDkz743youZTdB85qlnc2AIGOTWnmwEjqjR13GpuQTY/i0c6C8Z -R1rSKjmCujH2rbnPnk7qRt7qSgsyC/lm3NLC7BtAeLxqCyOtbjhfsbIadHALoAlh -85PWqpJyTXqvuihJFdu9 ------END CERTIFICATE----- diff --git a/test/tlsSample/certwithkey.pem b/test/tlsSample/certwithkey.pem deleted file mode 100644 index 6dc6e28ce11ba17db92b2d6b564787061728a5fb..0000000000000000000000000000000000000000 --- a/test/tlsSample/certwithkey.pem +++ /dev/null @@ -1,35 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQCpHOrS9GBJFtH0hhT0/vM2Bh1vAiB3d4L4E4u9IXphzg/F4K/d -0MvgxWrQY38HRQtqj+CfczWqCpVivQsQCVvSB2YVckbgotFF6j1qdP3wzGex64WY -TEiZabJSCWGAnUtWCgvhCBRL0PzuaDfMAttN5qRNYZsgqWT1KhiyECCHCwIDAQAB -AoGBAI/w4xbnlkTfvZkpvxDBKHYlQkxIPSYyfTF2QYybwDUbVWWR118v5zjMEByL -c4XWiN8M054kS9sN4xUF3zKpJJMABaDVs+Mr7tDF8l+j767L730DYdAX8yH37nrK -H+myW7hvBwuYjssEiybgPpVfiVd48DiN9K/aIbr74tLSvYuRAkEA1p20d+gmeUJS -eYbpOusYGHAVBwM7xuWyrwyEcewzXxgZRhVzUTcP4T2Uk7iQRMqW/wDTaEpxGVtb -DFh/eot0dQJBAMm5ADFfvfQ0DVkSodZCc9UCQ80eTtrvL+xnGdEpKDARWwYbHM6P -wBx5VIJelj4mMmkfUPjqMHs47k3R5luunX8CQHkrFr3wAvDJQhk80ychnjwF48lO -yQwVmVl9XrWXHrXcvEA2UiITTVLk2qLAPCuqma+lPraN+ObRDkmdGXQNkhUCQBwg -cYhw4xmT0HClCm/HoEMJJ88H9NLOGw6Jaa4iYPoi0WBOk3uxy4Ws3T24Vpaf2NOT -jETI0q27yG6NX+NUu50CQGYj8frp0aDMO7Fxnz4dODuBeVpiT5UH+YcaEaan4plJ -Sgn2eo7jHktyEXVGmmemIJbpPiJmQT549RcX+M9c4iQ= ------END RSA PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIDUzCCATsCAQEwDQYJKoZIhvcNAQEFBQAwOjEcMBoGA1UEAxMTQXN0ZXJpc2sg -UHJpdmF0ZSBDQTEaMBgGA1UEChMRQXN0ZXJpc2sgdGVzdCBQQlgwHhcNMTQwMzA1 -MTk0MTU2WhcNMTUwMzA1MTk0MTU2WjApMQ0wCwYDVQQDEwRwY2FsMRgwFgYDVQQK -Ew9Bc3RlcmlzayBTZXJ2ZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKkc -6tL0YEkW0fSGFPT+8zYGHW8CIHd3gvgTi70hemHOD8Xgr93Qy+DFatBjfwdFC2qP -4J9zNaoKlWK9CxAJW9IHZhVyRuCi0UXqPWp0/fDMZ7HrhZhMSJlpslIJYYCdS1YK -C+EIFEvQ/O5oN8wC203mpE1hmyCpZPUqGLIQIIcLAgMBAAEwDQYJKoZIhvcNAQEF -BQADggIBACBcy6n+S2SIOdCTiMr7A7xcHQB2pTHVgnp0twqxWyYmun3k+uIyTweE -IKCaZXvnz0+kW5Oo6dDcTZaXZkRhLdDWCXYcWGE2fDA16ZwUXUBRpf8t1wrssEud -m+eBP7DQ8sNmUBuTiSZtFqyY4HYN426+ehbocByU7A7iRQ41dXKJJktNAUg5DQwh -bK4sWU4ktIWrQnlSKLe8O+1FSv3WqDgXeDcBhC49zgFEUy9BDUKmfnnCk1cLSmTq -8sGtYVcV8NbD5Cp9+uOf8/rQ3TndPLdS4RQy7QEEdI+ZOuVoMwd05rYQH9sWfQxy -WOTRuXqVOE5SsTy5yyRVI0lQ+71UoykaQeUsS9GNmVEfd0cAVSqI6T/58JEuesm8 -QlDFRtnAmBeqmGtGE62W68W3DjgeO7LlDMmOKtevWAH1pSUK6EgCph4tFOc2Csts -Ckve/t/WLoioEFubpWGNZ2LUe+qp4PcBsySAc3eUjjd8/e47BDn44L1DPfbzWE4i -QphIEwnsRjNqkrCKUYnvNjQtDTng8X/syeRJdX/2m4XICD5+DkawHfNW0nUs5MIk -wQ+DBESGDJRQymj14LVcQObuslZrkcPyCqf2O2hGP1Zvc+6SvQpjsEHUFZVMixli -Qwq9G4UcQDEmzR1ivmELX7tkpUOFdyIDlf6UvaIkSRpV0+EnShUo ------END CERTIFICATE----- diff --git a/test/tlsSample/corruptedkey.pem b/test/tlsSample/corruptedkey.pem deleted file mode 100644 index 9352ff819b4a9bc9a27c235602adc05c90d2402f..0000000000000000000000000000000000000000 --- a/test/tlsSample/corruptedkey.pem +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIFfQIBAAKCATEAo4zEq+yWgEhYE1VO8xdOe+ZegK9ImkfQU2MmcXJJRj3HuV2n -+hZ1VTtIlCfW7WcrC4/bs1YtfcgJFmjbOJFsE18jQNpRw1f6yD8bYW3Ovlnzqg+f -gs5O4BpGsAcQtMlp8acV2Xu/m3c4ASVHLsgKRCGap08md285oBESbJlciRuf5sXM -7fr39QFEXbpn2xjDBXrltlnp4fDbBO4dfIMsoD5ByPscyEThm7XJIW2MNlijo4PK -A9kPI6J+2b6jyehnIxosj6vcpjRbXhCcactJItUT4JtUSsFT6VnsuM4OmfxuxruE -5XvivTFG7HZWtZ8OkhW6Wmb6APEpArV5NHsQ0ko8Gx9wMJuV+VVkehjztNhyRZb3 -zMZF16FJKgmEmi17Eh5yvJtlbpPdDJyxt4AucQIDAQABAoIBMAPbCLPo4u9pRTJH -e5H9haskFixAdZy1frLIjpp0EEgoorG7BH+/0cpNmHttqQJ1wS0Hmi1TJcVmVtiB -ZlGiFAMs5f7cZrsNMutPmYylcw9HvZfPwHnr9S4RUINL11f7u5Sn1LsI0M6Qc/CK -kseDyy2/qcalprz6c4puFLrVMuuen9YvriWVquWv+h4AISwrl+ESU9+QTzaUTSUu -CCwyNXECgZkAyhiZTp/xziLtNfiYQMRZk6OYk2IW5co0t8P1jo+VDaKehFuFhQsx -6hNG6k2n3dA5MeZK4O+n5I0SGkc+MYyAWOtI0q7IiSFUn9PMwZXO91rBDG5VxFpT -srD5m86BQhfmMqpeWQgAXT/ZM1q4me4gtg9PAyJDVHLs5MV49szcH2YAVzWCLJ7e -/o9Xne7jOhUGRVzGpwZ8gP0CgZkAzywuNe+K51nFED+WSHmSw73eqxmFsdm7FHg0 -O9RykMT3vfXx1fMPQU01BbsA0w+NH/lAtgwxSSzHZPAAOYl6iB29BXErbqBpJsOz -1afqXlEAiQcA3uOgPWMWnORcLfdwvze8lndHYvQ6bu85CoPl/mv+PBNp9fJLvxMr -Xr1V8DPYUeWTPr8IOSDQ8qWXO5s/wtqOZxynR4UCgZkAtcV+Tqupz+C2Pu8D8m0o -rJRerWFyeuhulkLY4IrgY806io3PACVbldAU3rVOIUIhz3H1M3AbMIR6HcyqceKP -pmqpq2Wt1Tl3ZfIYnp3h87VbIZUz61HbKkPnnm4U8J+SW0vFZIq/2R+OepREqZ73 -KQmH5aexq4la7UF4VXNZIZya/dWQ6hVTON8wzUqKcjlq1IRn4N8CqPkCgZkAhW6t -LKvlyO/2jmqF/pPexRerLIQ5qbzUU3DAI7DHQRq7favEYMo1jxeNCO3SsB2aBXfi -B95+d+TRX998JZK4SqbssW6cTJogX4k4cGm/95MwRxEtrGDrOd5yGAa0oB54jY/2 -dOrKHZ+zavPEx1MAdQdVLZhLbM7rnltYWaKUkSqzLrwwQ/+B6lmKel3Qs+FgBb4C -bcL0sokCgZkAnKmzmzSLb1Hg2fMVXP+xtQJIwv2/2eDcOXfC+X5qoNK/KxSXF/co -U16nAVY4VwOrYLjUuOh1N8yhwj+7DrTx8F2Q4sWvoXcbBmJv46fJlsVMByuyiWPv -4q3rPEf1eQ6MBj0D9iY+JtvJmtPT0vQQa6O2gl2qFlbmlc8PCSj4hI5d19ePcQlg -ypRMPut1kF4EDNV6vcrnukA= ------END RSA PRIVATE KEY----- diff --git a/test/tlsSample/expired.crt b/test/tlsSample/expired.crt deleted file mode 100644 index 59e7b84e3b705f401be2278d0b3c4e3e6e9f43d1..0000000000000000000000000000000000000000 --- a/test/tlsSample/expired.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDDTCCAcWgAwIBAgIEU3FIpjANBgkqhkiG9w0BAQsFADAAMB4XDTE0MDUxMjIy -MTgxNVoXDTE0MDUxMzIyMTgxN1owADCCAVIwDQYJKoZIhvcNAQEBBQADggE/ADCC -AToCggExAKOMxKvsloBIWBNVTvMXTnvmXoCvSJpH0FNjJnFySUY9x7ldp/oWdVU7 -SJQn1u1nKwuP27NWLX3ICRZo2ziRbBNfI0DaUcNX+sg/G2Ftzr5Z86oPn4LOTuAa -RrAHELTJafGnFdl7v5t3OAElRy7ICkQhmqdPJndvOaAREmyZXIkbn+bFzO369/UB -RF26Z9sYwwV65bZZ6eHw2wTuHXyDLKA+Qcj7HMhE4Zu1ySFtjDZYo6ODygPZDyOi -ftm+o8noZyMaLI+r3KY0W14QnGnLSSLVE+CbVErBU+lZ7LjODpn8bsa7hOV74r0x -Rux2VrWfDpIVulpm+gDxKQK1eTR7ENJKPBsfcDCblflVZHoY87TYckWW98zGRdeh -SSoJhJotexIecrybZW6T3QycsbeALnECAwEAAaMvMC0wDAYDVR0TAQH/BAIwADAd -BgNVHQ4EFgQUHkzCfB7aF0ad9eqbrOwDAxA6vAgwDQYJKoZIhvcNAQELBQADggEx -AGmzz8Ta1v1MUYzUk1DE03rAG4Sh9Nyr7Jesj8jtWSFho+RzQISKAY7AfayGflmQ -NJndYp0H3B6AvhujRptNRQ0ybI/p4wV0PSVCBT8jGf83d3fCOZOC/45neg9KUVTJ -5Xtap5knIvQRCCfLIrAAUgYgjhOxfCAB56rDyRK6zEJ+lC2AJpweRMtXTGI/CbDl -BS7knAE30h6NChWLIjDFRvrLjupPMArrTOg92DGrdUsZF8OqisO/Eba0j+LE17q+ -jb3Ga3fW828CWJUQZNi1LuQCSRnyS90+yv0cK7oeyp2BAaTVDT0AY+VSMD5v+2Cb -Wv/J5lITKF3ees0x3NNquMcHvYfEqNfqFc1bubYut8isKwM67JVgCnvUPwKEm4fh -E8NXJ7eYiHS1/RCRqA8g/ZY= ------END CERTIFICATE----- diff --git a/test/tlsSample/fake.crt b/test/tlsSample/fake.crt deleted file mode 100644 index c66393ae02dd83a704ee7038ed9fe7b7d79d6c54..0000000000000000000000000000000000000000 Binary files a/test/tlsSample/fake.crt and /dev/null differ diff --git a/test/tlsSample/keyonly.pem b/test/tlsSample/keyonly.pem deleted file mode 100644 index ba2fc011aa7b10ef544501f9a6539106260b9b73..0000000000000000000000000000000000000000 --- a/test/tlsSample/keyonly.pem +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIFfQIBAAKCATEAo4zEq+yWgEhYE1VO8xdOe+ZegK9ImkfQU2MmcXJJRj3HuV2n -+hZ1VTtIlCfW7WcrC4/bs1YtfcgJFmjbOJFsE18jQNpRw1f6yD8bYW3Ovlnzqg+f -gs5O4BpGsAcQtMlp8acV2Xu/m3c4ASVHLsgKRCGap08md285oBESbJlciRuf5sXM -7fr39QFEXbpn2xjDBXrltlnp4fDbBO4dfIMsoD5ByPscyEThm7XJIW2MNlijo4PK -A9kPI6J+2b6jyehnIxosj6vcpjRbXhCcactJItUT4JtUSsFT6VnsuM4OmfxuxruE -5XvivTFG7HZWtZ8OkhW6Wmb6APEpArV5NHsQ0ko8Gx9wMJuV+VVkehjztNhyRZb3 -zMZF16FJKgmEmi17Eh5yvJtlbpPdDJyxt4AucQIDAQABAoIBMAPbCLPo4u9pRTJH -e5H9haskFixAdZy1frLIjpp0EEgoorG7BH+/0cpNmHttqQJ1wS0Hmi1TJcVmVtiB -ZlGiFAMs5f7cZrsNMutPmYylcw9HvZfPwHnr9S4RUINL11f7u5Sn1LsI0M6Qc/CK -+W+f5aYPiL7S/dwo8hnU7TNENktBLHbbSOZ/WSMcgYkYIOSoY8iYShwPaJUb99fY -0RgdY+ehoC+cswm65p9S5B/emjVtZU6Zb45L+LVmMHMiAxRR//Wpl1GzgG+wHmcu -KZ+a6oyCCdIoT5Mf7otdUBL+aTV13K8oW3vt+TdlA7EEPU3f6dsctB7H/kmE0jHh -kseDyy2/qcalprz6c4puFLrVMuuen9YvriWVquWv+h4AISwrl+ESU9+QTzaUTSUu -CCwyNXECgZkAyhiZTp/xziLtNfiYQMRZk6OYk2IW5co0t8P1jo+VDaKehFuFhQsx -6hNG6k2n3dA5MeZK4O+n5I0SGkc+MYyAWOtI0q7IiSFUn9PMwZXO91rBDG5VxFpT -srD5m86BQhfmMqpeWQgAXT/ZM1q4me4gtg9PAyJDVHLs5MV49szcH2YAVzWCLJ7e -/o9Xne7jOhUGRVzGpwZ8gP0CgZkAzywuNe+K51nFED+WSHmSw73eqxmFsdm7FHg0 -O9RykMT3vfXx1fMPQU01BbsA0w+NH/lAtgwxSSzHZPAAOYl6iB29BXErbqBpJsOz -1afqXlEAiQcA3uOgPWMWnORcLfdwvze8lndHYvQ6bu85CoPl/mv+PBNp9fJLvxMr -Xr1V8DPYUeWTPr8IOSDQ8qWXO5s/wtqOZxynR4UCgZkAtcV+Tqupz+C2Pu8D8m0o -rJRerWFyeuhulkLY4IrgY806io3PACVbldAU3rVOIUIhz3H1M3AbMIR6HcyqceKP -pmqpq2Wt1Tl3ZfIYnp3h87VbIZUz61HbKkPnnm4U8J+SW0vFZIq/2R+OepREqZ73 -KQmH5aexq4la7UF4VXNZIZya/dWQ6hVTON8wzUqKcjlq1IRn4N8CqPkCgZkAhW6t -LKvlyO/2jmqF/pPexRerLIQ5qbzUU3DAI7DHQRq7favEYMo1jxeNCO3SsB2aBXfi -B95+d+TRX998JZK4SqbssW6cTJogX4k4cGm/95MwRxEtrGDrOd5yGAa0oB54jY/2 -dOrKHZ+zavPEx1MAdQdVLZhLbM7rnltYWaKUkSqzLrwwQ/+B6lmKel3Qs+FgBb4C -bcL0sokCgZkAnKmzmzSLb1Hg2fMVXP+xtQJIwv2/2eDcOXfC+X5qoNK/KxSXF/co -U16nAVY4VwOrYLjUuOh1N8yhwj+7DrTx8F2Q4sWvoXcbBmJv46fJlsVMByuyiWPv -4q3rPEf1eQ6MBj0D9iY+JtvJmtPT0vQQa6O2gl2qFlbmlc8PCSj4hI5d19ePcQlg -ypRMPut1kF4EDNV6vcrnukA= ------END RSA PRIVATE KEY----- diff --git a/test/tlstest.cpp b/test/tlstest.cpp deleted file mode 100644 index 858cda5eac34d07eb6c73e4e50d4d415030f445a..0000000000000000000000000000000000000000 --- a/test/tlstest.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * ebail - 2015/02/18 - * unit test is based on old SDP manager code - * this test is disabled for the moment - * */ -#if 0 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "tlstest.h" -#include "account.h" -#include "test_utils.h" -#include "logger.h" - -#include "sip/tlsvalidator.h" - -namespace ring { namespace test { - -void TlsTest::testKey() -{ - TITLE(); - - const char *validKey = WORKSPACE "tlsSample/keyonly.pem"; - const char *validCertWithKey = WORKSPACE "tlsSample/certwithkey.pem"; - const char *corruptedKey = WORKSPACE "tlsSample/corruptedkey.pem"; - - CPPUNIT_ASSERT(containsPrivateKey(validKey) == 0); - - CPPUNIT_ASSERT(containsPrivateKey(validCertWithKey) == 0); - - CPPUNIT_ASSERT(containsPrivateKey(corruptedKey) != 0); -} - -void TlsTest::testCertificate() -{ - TITLE(); - - const char *validCa = WORKSPACE "tlsSample/ca.crt"; - const char *validCertificate = WORKSPACE "tlsSample/cert.crt"; - const char *fakeCertificate = WORKSPACE "tlsSample/fake.crt"; - const char *expiredCertificate = WORKSPACE "tlsSample/expired.crt"; - - CPPUNIT_ASSERT(certificateIsValid(NULL, validCa) == 0); - - CPPUNIT_ASSERT(certificateIsValid(validCa, validCertificate) == 0); - - // This is a png - CPPUNIT_ASSERT(certificateIsValid(NULL, fakeCertificate) != 0); - - // This would need a CA to be valid - CPPUNIT_ASSERT(certificateIsValid(NULL, validCertificate) != 0); - - // This is an invalid CA - CPPUNIT_ASSERT(certificateIsValid(validCertificate, validCertificate) != 0); - - // This certificate is expired - CPPUNIT_ASSERT(certificateIsValid(NULL, expiredCertificate) != 0); -} - -}} // namespace ring::test -#endif diff --git a/test/tlstest.h b/test/tlstest.h deleted file mode 100644 index e5f5150d2667df723865e1d3b7ea2654829f5d06..0000000000000000000000000000000000000000 --- a/test/tlstest.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2004-2016 Savoir-faire Linux Inc. - * - * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> - * - * 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, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * @file tsltest.cpp - * @brief Tests TLS setup. - * Check if certificate is valid - */ - -#ifndef TLS_TEST_ -#define TLS_TEST_ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -namespace ring { namespace test { - -class TlsTest: public CppUnit::TestFixture { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE(TlsTest); - CPPUNIT_TEST(testKey); - CPPUNIT_TEST(testCertificate); - CPPUNIT_TEST(testHostname); - CPPUNIT_TEST_SUITE_END(); - - public: - void testKey(); - void testCertificate(); - void testHostname(); -}; -/* Register our test module */ -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TlsTest, "TlsTest"); -CPPUNIT_TEST_SUITE_REGISTRATION(TlsTest); - -}} // namespace ring::test - -#endif // TLS_TEST_ diff --git a/test/waveSample/M1F1-int16WE-AFsp.wav b/test/waveSample/M1F1-int16WE-AFsp.wav deleted file mode 100644 index 6df1c305809b5cee7a8fa4b07e28ee4dcbe524cb..0000000000000000000000000000000000000000 Binary files a/test/waveSample/M1F1-int16WE-AFsp.wav and /dev/null differ diff --git a/tools/sippxml/account_uac_send_hangup.xml b/tools/sippxml/account_uac_send_hangup.xml deleted file mode 100644 index 8971769c591c52bbfd1c89cc1e96e46c71fe3860..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uac_send_hangup.xml +++ /dev/null @@ -1,147 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <pause milliseconds="200"/> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 3 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="401" auth="true"> - </recv> - - <pause milliseconds="200"/> - - <send> - <![CDATA[ - - ACK sip:27182@[remote_ip] SIP/2.0 - Max-Forwards: 70 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 4 ACK - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@:[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 5 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - [authentication username=27182 password=1234] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100"> - </recv> - - <recv response="180"> - </recv> - - - <recv response="200"> - </recv> - - <send> - <![CDATA[ - - ACK sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] - To: <sip:2000@192.168.50.79:[remote_port]> - Call-ID: [call_id] - CSeq: 5 ACK - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - BYE sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] - To: <sip:2000@192.168.50.79:[remote_port]> - Call-ID: [call_id] - CSeq: 6 BYE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200"> - </recv> - - <pause milliseconds="1000"/> - -</scenario> diff --git a/tools/sippxml/account_uac_send_peer_hungup.xml b/tools/sippxml/account_uac_send_peer_hungup.xml deleted file mode 100644 index 716da9dd6de55534e79d29e2efa54ad6248ccc5c..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uac_send_peer_hungup.xml +++ /dev/null @@ -1,155 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <pause milliseconds="200"/> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@[remote_ip]>;tag=[call_number] - To: <sip:2000@[remote_ip]> - Call-ID: [call_id] - CSeq: 3 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="401" auth="true"> - </recv> - - <pause milliseconds="200"/> - - <send> - <![CDATA[ - - ACK sip:27182@[remote_ip] SIP/2.0 - Max-Forwards: 70 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[remote_ip]>;tag=[call_number] - To: <sip:2000@[remote_ip]> - Call-ID: [call_id] - CSeq: 4 ACK - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@:[remote_ip]>;tag=[call_number] - To: <sip:2000@[remote_ip]> - Call-ID: [call_id] - CSeq: 5 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - [authentication username=27182 password=1234] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100"> - </recv> - - <recv response="180"> - </recv> - - - <recv response="200"> - </recv> - - <send> - <![CDATA[ - - ACK sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[remote_ip]>;tag=[call_number] - To: <sip:2000@[remote_ip]> - Call-ID: [call_id] - CSeq: 5 ACK - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv request="BYE"> - </recv> - - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <pause milliseconds="1000"/> - -</scenario> diff --git a/tools/sippxml/account_uas_receive_transfer.xml b/tools/sippxml/account_uas_receive_transfer.xml deleted file mode 100644 index 80a875fbf707be6c6f3c03c2484be68c7c255ce4..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uas_receive_transfer.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <recv request="INVITE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <recv request="INVITE"> - </recv> - - <pause milliseconds="200"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - -</scenario> diff --git a/tools/sippxml/account_uas_recv_hangup.xml b/tools/sippxml/account_uas_recv_hangup.xml deleted file mode 100644 index 94bea4704232386a5518de7995c3138bc3007850..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uas_recv_hangup.xml +++ /dev/null @@ -1,119 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <recv request="INVITE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <pause milliseconds="200"/> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <recv request="INVITE"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <send retrans="500"> - <![CDATA[ - - BYE sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] - To: <sip:2000@192.168.50.79:[remote_port]> - Call-ID: [call_id] - CSeq: 6 BYE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200"> - </recv> - -</scenario> diff --git a/tools/sippxml/account_uas_recv_peer_hungup.xml b/tools/sippxml/account_uas_recv_peer_hungup.xml deleted file mode 100644 index c91230c7fc32e2c853d934ec5dbc3f499060d958..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uas_recv_peer_hungup.xml +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <recv request="INVITE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <recv request="INVITE"> - </recv> - - <pause milliseconds="200"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <recv request="BYE"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - -</scenario> diff --git a/tools/sippxml/account_uas_recv_transfered.xml b/tools/sippxml/account_uas_recv_transfered.xml deleted file mode 100644 index 8e67f3cec2ec2676afc03e8519351c9193f1996e..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uas_recv_transfered.xml +++ /dev/null @@ -1,132 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <recv request="INVITE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - <recv request="INVITE"> - </recv> - - <pause milliseconds="200"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK"> - </recv> - - - <!-- - - <recv request="BYE"> - </recv> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - --> - -</scenario> diff --git a/tools/sippxml/account_uas_register.xml b/tools/sippxml/account_uas_register.xml deleted file mode 100644 index e4ebb812276270bd5a3334ecd61a4b4c2825900c..0000000000000000000000000000000000000000 --- a/tools/sippxml/account_uas_register.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <send retrans="500"> - <![CDATA[ - - REGISTER sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - Max-Forwards: 70 - From: <sip:27182@[remote_ip]>;tag=[call_number] - To: <sip:27182@[remote_ip]> - Call-ID: REG///[call_id] - CSeq: 1 REGISTER - Contact: <sip:27182@[local_ip]:[local_port]> - Content-Length: 0 - Expires: 300 - - ]]> - </send> - - <recv response="401" auth="true"> - </recv> - - <send retrans="500"> - <![CDATA[ - - REGISTER sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - Max-Forwards: 70 - From: <sip:27182@[remote_ip]>;tag=[call_number] - To: <sip:27182@[remote_ip]> - Call-ID: REG///[call_id] - CSeq: 2 REGISTER - Contact: <sip:27182@[local_ip]:[local_port]> - Content-Length: 0 - Expires: 300 - [authentication username=27182 password=1234] - - ]]> - </send> - - <recv response="200"> - </recv> - -</scenario> diff --git a/tools/sippxml/accountcalluac.xml b/tools/sippxml/accountcalluac.xml deleted file mode 100644 index a5ba5ac2837e45ceda1d67fe9bbb06226ec48543..0000000000000000000000000000000000000000 --- a/tools/sippxml/accountcalluac.xml +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <send retrans="500"> - <![CDATA[ - - REGISTER sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - Max-Forward: 70 - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:27182@[remote_ip]:[remote_port]> - Call-ID: REG///[call_id] - CSeq: 1 REGISTER - Contact: <sip:27182@[remote_ip]:[remote_port]> - Content-Length: 0 - Expires: 300 - - ]]> - </send> - - <recv response="401" auth="true"> - </recv> - - <send retrans="500"> - <![CDATA[ - - REGISTER sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - Max-Forwards: 70 - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:27182@[remote_ip]:[remote_port]> - Call-ID: REG///[call_id] - CSeq: 2 REGISTER - Contact: <sip:27182@[remote_ip]:[remote_port]> - Content-Length: 0 - Expires: 300 - [authentication username=27182 password=1234] - - ]]> - </send> - - <recv response="200"> - </recv> - - <pause milliseconds="200"/> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 3 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="401" auth="true"> - </recv> - - <pause milliseconds="200"/> - - <send> - <![CDATA[ - - ACK sip:27182@[remote_ip] SIP/2.0 - Max-Forwards: 70 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 4 ACK - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:2000@[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:27182@:[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:2000@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 5 INVITE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - [authentication username=27182 password=1234] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100"> - </recv> - - <recv response="180"> - </recv> - - - <recv response="200"> - </recv> - - <send> - <![CDATA[ - - ACK sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] - To: <sip:2000@192.168.50.79:[remote_port]> - Call-ID: [call_id] - CSeq: 5 ACK - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - BYE sip:2000@192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] - To: <sip:2000@192.168.50.79:[remote_port]> - Call-ID: [call_id] - CSeq: 6 BYE - Contact: sip:27182@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - - <pause milliseconds="1000"/> - -</scenario> diff --git a/tools/sippxml/accountcalluas.xml b/tools/sippxml/accountcalluas.xml deleted file mode 100644 index 82158ef0a5c0fd85053aa9232d387d55e2ed219c..0000000000000000000000000000000000000000 --- a/tools/sippxml/accountcalluas.xml +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="branch_server"> - <recv request="REGISTER"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - Expires: 300 - - ]]> - </send> - - <!-- Set variable 3 if the ua is of the form ua2... --> - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="ua2" - search_in="hdr" - header="From: " - assign_to="3"/> - </action> - </recv> - - <!-- send 180 then trying if variable 3 is set --> - <send next="1" test="3"> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <!-- if not, send a 403 error then skip to wait for a BYE --> - <send next="2"> - <![CDATA[ - - SIP/2.0 403 Error - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <label id="1"/> - - <send> - <![CDATA[ - - SIP/2.0 100 Trying - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: 136 - - v=0 - o=user1 53655765 2353687637 IN IP4 127.0.0.1 - s=- - t=0 0 - c=IN IP4 [media_ip] - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <label id="2"/> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <!-- Keep the call open for a while in case the 200 is lost to be --> - <!-- able to retransmit it if we receive the BYE again. --> - <pause milliseconds="4000"/> - - <!-- Definition of the response time repartition table (unit is ms) --> - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <!-- Definition of the call length repartition table (unit is ms) --> - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/g711a.pcap b/tools/sippxml/g711a.pcap deleted file mode 100644 index bafea386f396eacbd14871f0156aed76df0166ee..0000000000000000000000000000000000000000 Binary files a/tools/sippxml/g711a.pcap and /dev/null differ diff --git a/tools/sippxml/ip2ip_uac_send_hangup.xml b/tools/sippxml/ip2ip_uac_send_hangup.xml deleted file mode 100644 index 5c9673644d278302d2b66d773605c31bc7321cf5..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ip_uac_send_hangup.xml +++ /dev/null @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" optional="true"> - </recv> - - <recv response="180"> - </recv> - - - <recv response="200"> - <action> - <ereg regexp="tag=.*" search_in="hdr" header="To:" check_it="true" assign_to="1" /> - </action> - </recv> - - <send> - <![CDATA[ - - ACK sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:[local_ip]:[local_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]>;tag=[$1] - Call-ID: [call_id] - CSeq: 2 ACK - Contact: sip:[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - BYE sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:[local_ip]:[local_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]>;tag=[$1] - Call-ID: [call_id] - CSeq: 3 BYE - Contact: sip:[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200"> - </recv> - -</scenario> diff --git a/tools/sippxml/ip2ip_uac_send_peer_hungup.xml b/tools/sippxml/ip2ip_uac_send_peer_hungup.xml deleted file mode 100644 index 048b0d8a062521288ed6afc5c21934a2232dd30a..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ip_uac_send_peer_hungup.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- 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 2 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, write to the --> -<!-- Free Software Foundation, Inc., --> -<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - -<scenario name="accountcall_client"> - - <send retrans="1000"> - <![CDATA[ - - INVITE sip:[remote_ip] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:[remote_ip]:[remote_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" optional="true"> - </recv> - - <recv response="180"> - </recv> - - <recv response="200"> - </recv> - - <send> - <![CDATA[ - - ACK sip:192.168.50.79 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:[local_ip]:[local_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 2 ACK - Contact: sip:[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - -</scenario> diff --git a/tools/sippxml/ip2ip_uas_recv_hangup.xml b/tools/sippxml/ip2ip_uas_recv_hangup.xml deleted file mode 100644 index 45023d08fa640276cd296c5e8599f38309387430..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ip_uas_recv_hangup.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="Basic UAS responder"> - - <recv request="INVITE" crlf="true"> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <!-- tag from From: header is required to build the To: header in - -- Bye request. --> - - <recv request="ACK"> - <action> - <ereg regexp="tag=.*" search_in="hdr" header="From:" check_it="true" assign_to="1" /> - </action> - </recv> - - <pause milliseconds="500"/> - - <send retrans="500"> - <![CDATA[ - - BYE sip:[service] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] - From: <sip:[local_ip]:[local_port]>;tag=[call_number] - To: <sip:[remote_ip]:[remote_port]>;[$1] - [last_Call-ID:] - CSeq: [cseq] BYE - Contact: <sip:test@[local_ip]:[local_port]> - Max-Forwards: 70 - Subject: Functional Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200"> - </recv> - - <pause milliseconds="1000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/ip2ip_uas_recv_hold_offhold.xml b/tools/sippxml/ip2ip_uas_recv_hold_offhold.xml deleted file mode 100644 index bae7eaa2bc795eafd357f3ca30e18433c1220a2e..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ip_uas_recv_hold_offhold.xml +++ /dev/null @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="UAS HOLD/OFFHOLD"> - - <!-- Receive a new call --> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="1"/> - <log message="Media is [$1]"/> - </action> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> -</send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- This call is now on HOLD: sendonly tell to PBX to send music on hold--> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendonly" search_in="body" check_it="true" assign_to="2"/> - <log message="Media is [$2]"/> - </action> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- OFFHOLD this call --> - - <recv request="INVITE" crlf="true"> - <action> - <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="3"/> - <log message="Media is [$3]"/> - </action> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <!-- Hangup this call --> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <pause milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/ip2ip_uas_recv_peer_hungup.xml b/tools/sippxml/ip2ip_uas_recv_peer_hungup.xml deleted file mode 100644 index 0d9da874ba1a50bcb54e2ba0eb6693c467e2490b..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ip_uas_recv_peer_hungup.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="Basic UAS responder"> - - <recv request="INVITE" crlf="true"> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> -</send> - - <recv request="ACK" optional="true" rtd="true" crlf="true"> - </recv> - - <recv request="INVITE" optional="true"> - </recv> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/ip2ipcalluac.xml b/tools/sippxml/ip2ipcalluac.xml deleted file mode 100644 index 7d146cec2be6de5f01edb54d14e0f240d4dc22cc..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ipcalluac.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="Basic Sipstone UAC"> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" - optional="true"> - </recv> - - <recv response="180" optional="true"> - </recv> - - <recv response="200" rtd="true"> - </recv> - - <send> - <![CDATA[ - - ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 1 ACK - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <pause/> - - <send retrans="500"> - <![CDATA[ - - BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 2 BYE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200" crlf="true"> - </recv> - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/ip2ipcalluas.xml b/tools/sippxml/ip2ipcalluas.xml deleted file mode 100644 index 08d17440ea5a7f593bbd1992511761f929cefdb9..0000000000000000000000000000000000000000 --- a/tools/sippxml/ip2ipcalluas.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - - -<scenario name="Basic UAS responder"> - - <recv request="INVITE" crlf="true"> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <pause milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/simpleServiceRoute.xml b/tools/sippxml/simpleServiceRoute.xml deleted file mode 100644 index c20071763179f9ee9fa1f4b9c084122ec007b03c..0000000000000000000000000000000000000000 --- a/tools/sippxml/simpleServiceRoute.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<scenario name="Basic Sipstone UAC"> - - <send retrans="500"> - <![CDATA[ - - INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]> - Call-ID: [call_id] - CSeq: 1 INVITE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Type: application/sdp - Content-Length: [len] - Route: <sip:sipp@[local_ip]:[local_port]> - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv response="100" - optional="true"> - </recv> - - <recv response="183" optional="true"> - </recv> - - <recv response="200" rtd="true"> - </recv> - - <send> - <![CDATA[ - - ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 1 ACK - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <pause/> - - <send retrans="500"> - <![CDATA[ - - BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] - To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] - Call-ID: [call_id] - CSeq: 2 BYE - Contact: sip:sipp@[local_ip]:[local_port] - Max-Forwards: 70 - Subject: Performance Test - Content-Length: 0 - - ]]> - </send> - - <recv response="200" crlf="true"> - </recv> - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/sippusage.txt b/tools/sippxml/sippusage.txt deleted file mode 100644 index f1a519088278b35d0023b60c82764592de926f52..0000000000000000000000000000000000000000 --- a/tools/sippxml/sippusage.txt +++ /dev/null @@ -1,460 +0,0 @@ -Usage: - - sipp remote_host[:remote_port] [options] - - Available options: - - -v : Display version and copyright information. - - -aa : Enable automatic 200 OK answer for INFO, UPDATE and - NOTIFY messages. - - -auth_uri : Force the value of the URI for authentication. - By default, the URI is composed of - remote_ip:remote_port. - - -base_cseq : Start value of [cseq] for each call. - - -bg : Launch SIPp in background mode. - - -bind_local : Bind socket to local IP address, i.e. the local IP - address is used as the source IP address. If SIPp runs - in server mode it will only listen on the local IP - address instead of all IP addresses. - - -buff_size : Set the send and receive buffer size. - - -calldebug_file : Set the name of the call debug file. - - -calldebug_overwrite: Overwrite the call debug file (default true). - - -cid_str : Call ID string (default %u-%p@%s). %u=call_number, - %s=ip_address, %p=process_number, %%=% (in any order). - - -ci : Set the local control IP address - - -cp : Set the local control port number. Default is 8888. - - -d : Controls the length of calls. More precisely, this - controls the duration of 'pause' instructions in the - scenario, if they do not have a 'milliseconds' section. - Default value is 0 and default unit is milliseconds. - - -deadcall_wait : How long the Call-ID and final status of calls should be - kept to improve message and error logs (default unit is - ms). - - -default_behaviors: Set the default behaviors that SIPp will use. Possbile - values are: - - all Use all default behaviors - - none Use no default behaviors - - bye Send byes for aborted calls - - abortunexp Abort calls on unexpected messages - - pingreply Reply to ping requests - If a behavior is prefaced with a -, then it is turned - off. Example: all,-bye - - - -error_file : Set the name of the error log file. - - -error_overwrite : Overwrite the error log file (default true). - - -f : Set the statistics report frequency on screen. Default is - 1 and default unit is seconds. - - -fd : Set the statistics dump log report frequency. Default is - 60 and default unit is seconds. - - -i : Set the local IP address for 'Contact:','Via:', and - 'From:' headers. Default is primary host IP address. - - - -inf : Inject values from an external CSV file during calls into - the scenarios. - First line of this file say whether the data is to be - read in sequence (SEQUENTIAL), random (RANDOM), or user - (USER) order. - Each line corresponds to one call and has one or more - ';' delimited data fields. Those fields can be referred - as [field0], [field1], ... in the xml scenario file. - Several CSV files can be used simultaneously (syntax: - -inf f1.csv -inf f2.csv ...) - - -infindex : file field - Create an index of file using field. For example -inf - users.csv -infindex users.csv 0 creates an index on the - first key. - - -ip_field : Set which field from the injection file contains the IP - address from which the client will send its messages. - If this option is omitted and the '-t ui' option is - present, then field 0 is assumed. - Use this option together with '-t ui' - - -l : Set the maximum number of simultaneous calls. Once this - limit is reached, traffic is decreased until the number - of open calls goes down. Default: - (3 * call_duration (s) * rate). - - -log_file : Set the name of the log actions log file. - - -log_overwrite : Overwrite the log actions log file (default true). - - -lost : Set the number of packets to lose by default (scenario - specifications override this value). - - -rtcheck : Select the retransmisison detection method: full - (default) or loose. - - -m : Stop the test and exit when 'calls' calls are processed - - -mi : Set the local media IP address (default: local primary - host IP address) - - -master : 3pcc extended mode: indicates the master number - - -max_recv_loops : Set the maximum number of messages received read per - cycle. Increase this value for high traffic level. The - default value is 1000. - - -max_sched_loops : Set the maximum number of calsl run per event loop. - Increase this value for high traffic level. The default - value is 1000. - - -max_reconnect : Set the the maximum number of reconnection. - - -max_retrans : Maximum number of UDP retransmissions before call ends on - timeout. Default is 5 for INVITE transactions and 7 for - others. - - -max_invite_retrans: Maximum number of UDP retransmissions for invite - transactions before call ends on timeout. - - -max_non_invite_retrans: Maximum number of UDP retransmissions for non-invite - transactions before call ends on timeout. - - -max_log_size : What is the limit for error and message log file sizes. - - -max_socket : Set the max number of sockets to open simultaneously. - This option is significant if you use one socket per - call. Once this limit is reached, traffic is distributed - over the sockets already opened. Default value is 50000 - - -mb : Set the RTP echo buffer size (default: 2048). - - -message_file : Set the name of the message log file. - - -message_overwrite: Overwrite the message log file (default true). - - -mp : Set the local RTP echo port number. Default is 6000. - - -nd : No Default. Disable all default behavior of SIPp which - are the following: - - On UDP retransmission timeout, abort the call by - sending a BYE or a CANCEL - - On receive timeout with no ontimeout attribute, abort - the call by sending a BYE or a CANCEL - - On unexpected BYE send a 200 OK and close the call - - On unexpected CANCEL send a 200 OK and close the call - - On unexpected PING send a 200 OK and continue the call - - On any other unexpected message, abort the call by - sending a BYE or a CANCEL - - - -nr : Disable retransmission in UDP mode. - - -nostdin : Disable stdin. - - - -p : Set the local port number. Default is a random free port - chosen by the system. - - -pause_msg_ign : Ignore the messages received during a pause defined in - the scenario - - -periodic_rtd : Reset response time partition counters each logging - interval. - - -plugin : Load a plugin. - - -r : Set the call rate (in calls per seconds). This value can - bechanged during test by pressing '+','_','*' or '/'. - Default is 10. - pressing '+' key to increase call rate by 1 * - rate_scale, - pressing '-' key to decrease call rate by 1 * - rate_scale, - pressing '*' key to increase call rate by 10 * - rate_scale, - pressing '/' key to decrease call rate by 10 * - rate_scale. - If the -rp option is used, the call rate is calculated - with the period in ms given by the user. - - -rp : Specify the rate period for the call rate. Default is 1 - second and default unit is milliseconds. This allows - you to have n calls every m milliseconds (by using -r n - -rp m). - Example: -r 7 -rp 2000 ==> 7 calls every 2 seconds. - -r 10 -rp 5s => 10 calls every 5 seconds. - - -rate_scale : Control the units for the '+', '-', '*', and '/' keys. - - -rate_increase : Specify the rate increase every -fd units (default is - seconds). This allows you to increase the load for each - independent logging period. - Example: -rate_increase 10 -fd 10s - ==> increase calls by 10 every 10 seconds. - - -rate_max : If -rate_increase is set, then quit after the rate - reaches this value. - Example: -rate_increase 10 -rate_max 100 - ==> increase calls by 10 until 100 cps is hit. - - -no_rate_quit : If -rate_increase is set, do not quit after the rate - reaches -rate_max. - - -recv_timeout : Global receive timeout. Default unit is milliseconds. If - the expected message is not received, the call times out - and is aborted. - - -send_timeout : Global send timeout. Default unit is milliseconds. If a - message is not sent (due to congestion), the call times - out and is aborted. - - -sleep : How long to sleep for at startup. Default unit is - seconds. - - -reconnect_close : Should calls be closed on reconnect? - - -reconnect_sleep : How long (in milliseconds) to sleep between the close and - reconnect? - - -ringbuffer_files: How many error/message files should be kept after - rotation? - - -ringbuffer_size : How large should error/message files be before they get - rotated? - - -rsa : Set the remote sending address to host:port for sending - the messages. - - -rtp_echo : Enable RTP echo. RTP/UDP packets received on port defined - by -mp are echoed to their sender. - RTP/UDP packets coming on this port + 2 are also echoed - to their sender (used for sound and video echo). - - -rtt_freq : freq is mandatory. Dump response times every freq calls - in the log file defined by -trace_rtt. Default value is - 200. - - -s : Set the username part of the resquest URI. Default is - 'service'. - - -sd : Dumps a default scenario (embeded in the sipp executable) - - -sf : Loads an alternate xml scenario file. To learn more - about XML scenario syntax, use the -sd option to dump - embedded scenarios. They contain all the necessary help. - - -shortmessage_file: Set the name of the short message log file. - - -shortmessage_overwrite: Overwrite the short message log file (default true). - - -oocsf : Load out-of-call scenario. - - -oocsn : Load out-of-call scenario. - - -skip_rlimit : Do not perform rlimit tuning of file descriptor limits. - Default: false. - - -slave : 3pcc extended mode: indicates the slave number - - -slave_cfg : 3pcc extended mode: indicates the file where the master - and slave addresses are stored - - -sn : Use a default scenario (embedded in the sipp executable). - If this option is omitted, the Standard SipStone UAC - scenario is loaded. - Available values in this version: - - - 'uac' : Standard SipStone UAC (default). - - 'uas' : Simple UAS responder. - - 'regexp' : Standard SipStone UAC - with regexp and - variables. - - 'branchc' : Branching and conditional branching in - scenarios - client. - - 'branchs' : Branching and conditional branching in - scenarios - server. - - Default 3pcc scenarios (see -3pcc option): - - - '3pcc-C-A' : Controller A side (must be started after - all other 3pcc scenarios) - - '3pcc-C-B' : Controller B side. - - '3pcc-A' : A side. - - '3pcc-B' : B side. - - - -stat_delimiter : Set the delimiter for the statistics file - - -stf : Set the file name to use to dump statistics - - -t : Set the transport mode: - - u1: UDP with one socket (default), - - un: UDP with one socket per call, - - ui: UDP with one socket per IP address The IP - addresses must be defined in the injection file. - - t1: TCP with one socket, - - tn: TCP with one socket per call, - - l1: TLS with one socket, - - ln: TLS with one socket per call, - - c1: u1 + compression (only if compression plugin - loaded), - - cn: un + compression (only if compression plugin - loaded). This plugin is not provided with sipp. - - - -timeout : Global timeout. Default unit is seconds. If this option - is set, SIPp quits after nb units (-timeout 20s quits - after 20 seconds). - - -timeout_error : SIPp fails if the global timeout is reached is set - (-timeout option required). - - -timer_resol : Set the timer resolution. Default unit is milliseconds. - This option has an impact on timers precision.Small - values allow more precise scheduling but impacts CPU - usage.If the compression is on, the value is set to - 50ms. The default value is 10ms. - - -sendbuffer_warn : Produce warnings instead of errors on SendBuffer - failures. - - -trace_msg : Displays sent and received SIP messages in <scenario file - name>_<pid>_messages.log - - -trace_shortmsg : Displays sent and received SIP messages as CSV in - <scenario file name>_<pid>_shortmessages.log - - -trace_screen : Dump statistic screens in the - <scenario_name>_<pid>_ s.log file when quitting - SIPp. Useful to get a final status report in background - mode (-bg option). - - -trace_err : Trace all unexpected messages in <scenario file - name>_<pid>_errors.log. - - -trace_calldebug : Dumps debugging information about aborted calls to - <scenario_name>_<pid>_calldebug.log file. - - -trace_stat : Dumps all statistics in <scenario_name>_<pid>.csv file. - Use the '-h stat' option for a detailed description of - the statistics file content. - - -trace_counts : Dumps individual message counts in a CSV file. - - -trace_rtt : Allow tracing of all response times in <scenario file - name>_<pid>_rtt.csv. - - -trace_logs : Allow tracing of <log> actions in <scenario file - name>_<pid>_logs.log. - - -users : Instead of starting calls at a fixed rate, begin 'users' - calls at startup, and keep the number of calls constant. - - -watchdog_interval: Set gap between watchdog timer firings. Default is 400. - - -watchdog_reset : If the watchdog timer has not fired in more than this - time period, then reset the max triggers counters. - Default is 10 minutes. - - -watchdog_minor_threshold: If it has been longer than this period between watchdog - executions count a minor trip. Default is 500. - - -watchdog_major_threshold: If it has been longer than this period between watchdog - executions count a major trip. Default is 3000. - - -watchdog_major_maxtriggers: How many times the major watchdog timer can be tripped - before the test is terminated. Default is 10. - - -watchdog_minor_maxtriggers: How many times the minor watchdog timer can be tripped - before the test is terminated. Default is 120. - - -ap : Set the password for authentication challenges. Default - is 'password - - -tls_cert : Set the name for TLS Certificate file. Default is - 'cacert.pem - - -tls_key : Set the name for TLS Private Key file. Default is - 'cakey.pem' - - -tls_crl : Set the name for Certificate Revocation List file. If not - specified, X509 CRL is not activated. - - -3pcc : Launch the tool in 3pcc mode ("Third Party call - control"). The passed ip address is depending on the - 3PCC role. - - When the first twin command is 'sendCmd' then this is - the address of the remote twin socket. SIPp will try to - connect to this address:port to send the twin command - (This instance must be started after all other 3PCC - scenarii). - Example: 3PCC-C-A scenario. - - When the first twin command is 'recvCmd' then this is - the address of the local twin socket. SIPp will open - this address:port to listen for twin command. - Example: 3PCC-C-B scenario. - - -tdmmap : Generate and handle a table of TDM circuits. - A circuit must be available for the call to be placed. - Format: -tdmmap {0-3}{99}{5-8}{1-31} - - -key : keyword value - Set the generic parameter named "keyword" to "value". - - -set : variable value - Set the global variable parameter named "variable" to - "value". - - -dynamicStart : variable value - Set the start offset of dynamic_id varaiable - - -dynamicMax : variable value - Set the maximum of dynamic_id variable - - -dynamicStep : variable value - Set the increment of dynamic_id variable - -Signal handling: - - SIPp can be controlled using posix signals. The following signals - are handled: - USR1: Similar to press 'q' keyboard key. It triggers a soft exit - of SIPp. No more new calls are placed and all ongoing calls - are finished before SIPp exits. - Example: kill -SIGUSR1 732 - USR2: Triggers a dump of all statistics screens in - <scenario_name>_<pid>_screens.log file. Especially useful - in background mode to know what the current status is. - Example: kill -SIGUSR2 732 - -Exit code: - - Upon exit (on fatal error or when the number of asked calls (-m - option) is reached, sipp exits with one of the following exit - code: - 0: All calls were successful - 1: At least one call failed - 97: exit on internal command. Calls may have been processed - 99: Normal exit without calls processed - -1: Fatal error - - -Example: - - Run sipp with embedded server (uas) scenario: - ./sipp -sn uas - On the same host, run sipp with embedded client (uac) scenario - ./sipp -sn uac 127.0.0.1 diff --git a/tools/sippxml/tempscript.sh b/tools/sippxml/tempscript.sh deleted file mode 100644 index 090a058ed8491511f8ef33551e260d56237be826..0000000000000000000000000000000000000000 --- a/tools/sippxml/tempscript.sh +++ /dev/null @@ -1,5 +0,0 @@ -SERVERPORT=5064 - -sipp -sf account_uas_register_bis.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 -m 1 - -sipp -sf account_uas_receive_transfer.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 \ No newline at end of file diff --git a/tools/sippxml/testEarlyMedia.xml b/tools/sippxml/testEarlyMedia.xml deleted file mode 100644 index 7909bebecdf70737018cb6dac38166dff40a57a5..0000000000000000000000000000000000000000 --- a/tools/sippxml/testEarlyMedia.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<!-- sudo sipp -sf testEarlyMedia.xml 127.0.0.1 -i 127.0.0.1 -p 5062 -l 1 -m 1 -mp 6000 --> - -<scenario name="Basic UAS responder"> - - <recv request="INVITE" crlf="true"> - </recv> - - - <send> - <![CDATA[ - - SIP/2.0 100 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send> - <![CDATA[ - - SIP/2.0 183 Trying - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <!-- Play a pre-recorded PCAP file (RTP stream) --> - <nop> - <action> - <exec play_pcap_audio="g711a.pcap"/> - </action> - </nop> - - <!-- Pause 8 seconds, which is approximately the duration of the --> - <!-- PCAP file --> - <pause milliseconds="8000"/> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: [len] - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <pause milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - -</scenario> diff --git a/tools/sippxml/testsuiteuac.sh b/tools/sippxml/testsuiteuac.sh deleted file mode 100644 index 563500358296d6a2097ffadd7554bf9d16c4da87..0000000000000000000000000000000000000000 --- a/tools/sippxml/testsuiteuac.sh +++ /dev/null @@ -1,383 +0,0 @@ -#!/bin/bash - - -LOCALPORT=5062 -LOCALIP_lo=127.0.0.1 -LOCALIP_eth0=192.168.50.182 - -REMOTEADDR_lo=127.0.0.1:5060 -REMOTEADDR_ast=192.168.50.79 - -# SCENARIO 1 Test 1 -function test_ip2ip_send_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # start sipp server to receive calls from sflphone - sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} - - # wait some time to make sure sflphoned is started - # sleep 1; - - # run python client and script to make calls - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # kill every one - # bashtrap -} - -# SCENARIO 1 Test 2 -function test_ip2ip_send_peer_hungup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # start sipp server to receive calls from sflphone and then hangup - sipp -sf ip2ip_uas_recv_hangup.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} - - # wait some time to make sure sflphoned is started - # sleep 1; - - # run python client and script to make calls - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # kill every one - bashtrap -} - - -# SCENARIO 1 Test 3 -function test_ip2ip_recv_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # start sipp client and send calls - sipp -sf ip2ip_uac_send_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10 - - # kill every one - # bashtrap -} - - -# SCENARIO 1 Test 4 -function test_ip2ip_recv_peer_hungup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # start sipp client and send calls - sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10 - - # kill every one - # bashtrap -} - - -# SCENARIO 2 Test 1 -function test_account_send_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # process only one registration - sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 - - # start sipp client and send calls - sipp -sf account_uas_recv_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 - - # kill every one - # bashtrap -} - -# SCENARIO 2 Test 2 -function test_account_send_peer_hungup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # process only one registration - sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 - - # start sipp client and send calls - sipp -sf account_uas_recv_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 - - # kill every one - # bashtrap -} - -# SCENARIO 2 Test 3 -function test_account_recv_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # process only one registration - sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 - - # start sipp client and send calls - sipp -sf account_uac_send_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10 - # kill every one - # bashtrap -} - -# SCENARIO 2 Test 4 -function test_account_recv_peer_hungup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # process only one registration - sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 - - # start sipp client and send calls - sipp -sf account_uac_send_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10 - - # kill every one - # bashtrap -} - -# SCENARIO 3 Test 1 -function test_ip2ip_send_hold_offhold { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # start sipp client and send calls - sipp -sf ip2ip_uas_recv_hold_offhold.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} - # kill every one - # bashtrap -} - -# SCENARIO 4 Test 1 -function test_account_send_transfer { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # wait some time to make sure sflphoned is started - # sleep 1; - - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # wait some time to make sure client is bound - # sleep 1; - - # process only one registration - sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 - - # start sipp client and send calls - sipp -sf account_uas_recv_transfered.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 - - # kill every one - # bashtrap -} - - -# SCENARIO 5 Test 1 -function test_ip2ip_send_refused { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # start sipp server to receive calls from sflphone and then hangup - sipp -sf ip2ip_uac_send_refused.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 - - # wait some time to make sure sflphoned is started - # sleep 1; - - # run python client and script to make calls - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # kill every one - bashtrap -} - - -# SCENARIO 6 Test 1 -function test_mult_ip2ip_send_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # start sipp server to receive calls from sflphone - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5062 -l 1 -m 10 - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5064 -l 1 -m 10 - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1:5060 -i 127.0.0.1 -p 5066 -l 1 -m 10 - # sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10 - - # wait some time to make sure sflphoned is started - # sleep 1; - - # run python client and script to make calls - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # kill every one - # bashtrap -} - - -# SCENARIO 6 Test 2 -function test_mult_ip2ip_recv_peer_hangup { - - # start sflphoned - # /usr/lib/sflphone/sflphoned& - - # start sipp server to receive calls from sflphone - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5062 - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5064 - sipp -sf ip2ip_uac_send_hangup.xml 127.0.0.1 -i 127.0.0.1:5060 -p 5066 - # sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} - - # wait some time to make sure sflphoned is started - # sleep 1; - - # run python client and script to make calls - # python ../tools/pysflphone/pysflphone_testdbus.py & - - # kill every one - # bashtrap -} - - -# function called if CTRL-C detected -bashtrap() -{ - killall sipp - killall sflphoned -} - - -# ============================ Test Suite ============================ - - - -# SCENARIO 1: (IP2IP) Normal flow calls - -# Test 1: - Send an IP2IP call -# - Hangup -test_ip2ip_send_hangup - -# Test 2: - Send an IP2IP call -# - Peer Hangup -# test_ip2ip_send_peer_hungup - -# Test 3: - Receive an IP2IP call -# - Hangup -# test_ip2ip_recv_hangup - -# Test 4: - Receive an IP2IP call -# - Peer Hangup -# test_ip2ip_recv_peer_hungup - - - -# SCENARIO 2: (ACCOUNT) Normal flow calls - -# Test 1: - Send an ACCOUNT call -# - Hangup -# test_account_send_hangup - -# Test 2: - Send an ACCOUNT call -# - Peer Hangup -# test_account_send_peer_hungup - -# Test 3: - Receive an ACCOUNT call -# - Hangup -# test_account_recv_hangup - -# Test 4: - Receive an ACCOUNT call -# - Peer Hangup -# test_account_recv_peer_hungup - - - -# SCENARIO 3: Hold/offHold calls (Account) - -# Test 1: - Send an IP2IP call -# - Put this call on HOLD -# - Off HOLD this call -# - Hangup -# test_ip2ip_send_hold_offhold - - - -# SCENARIO 4: Transfer calls (Account) - -# Test 1: - Send an IP2IP call -# - Transfer this call to another sipp instance -# - Hangup -# test_account_send_transfer - - -#SCENARIO 5: Refuse call (IP2IP) - -# Test 1: - Receive a call -# - Refuse (hangup without answer) -# test_ip2ip_send_refused - - -#SCENARIO 6: Multiple simultaneous Call - -# Test 1: - -# test_mult_ip2ip_send_hangup - -# Test 2: - -# test_mult_ip2ip_recv_peer_hangup \ No newline at end of file diff --git a/tools/sippxml/uac_register_diff_contact.xml b/tools/sippxml/uac_register_diff_contact.xml deleted file mode 100644 index c07d8a05f88a6ce9125d21f9f5a6c12cbbc2dcef..0000000000000000000000000000000000000000 --- a/tools/sippxml/uac_register_diff_contact.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-2" ?> - -<!-- Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000]; - (user part of uri, server address, auth tag in each line) ---> - -<scenario name="register_client"> - <send retrans="500"> - <![CDATA[ - - REGISTER sip:127.0.0.1 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:[field0]@[field1]>;tag=[call_number] - To: <sip:[field0]@[field1]> - Call-ID: [call_id] - CSeq: [cseq] REGISTER - Contact: sip:[field0]@[local_ip]:[local_port] - Max-Forwards: 10 - Expires: 120 - User-Agent: SIPp/Win32 - Content-Length: 0 - - ]]> - </send> - - <!-- asterisk --> - <recv response="200"> - <action> - <ereg regexp=".*" search_in="hdr" header="Contact:" check_it="true" assign_to="1" /> - </action> - </recv> - - <send retrans="500"> - <![CDATA[ - - REGISTER sip:127.0.0.1 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:[field0]@[field1]>;tag=[call_number] - To: <sip:[field0]@[field1]> - Call-ID: [call_id] - CSeq: [cseq] REGISTER - Contact: [$1] - Max-Forwards: 10 - Expires: 120 - User-Agent: SIPp/Win32 - Content-Length: 0 - - ]]> - </send> - - <recv response="200"> - </recv> - - -</scenario> diff --git a/tools/sippxml/uac_register_no_cvs_300.xml b/tools/sippxml/uac_register_no_cvs_300.xml deleted file mode 100644 index f22ae377a8df43ddbcd8800e4d1f57d49765d306..0000000000000000000000000000000000000000 --- a/tools/sippxml/uac_register_no_cvs_300.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-2" ?> - -<!-- Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000]; - (user part of uri, server address, auth tag in each line) ---> - -<scenario name="register_client"> - <send retrans="500"> - <![CDATA[ - - REGISTER sip:127.0.0.1 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:300@127.0.0.1>;tag=[call_number] - To: <sip:300@127.0.0.1> - Call-ID: [call_id] - CSeq: [cseq] REGISTER - Contact: sip:300@[local_ip]:[local_port] - Max-Forwards: 10 - Expires: 120 - User-Agent: SIPp/Win32 - Content-Length: 0 - - ]]> - </send> - - <!-- asterisk --> - <recv response="200"> - <!-- - <action> - <ereg regexp=".*" search_in="hdr" header="Contact:" check_it="true" assign_to="1" /> - </action> - --> - </recv> - - <!-- - <recv request="INVITE" crlf="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <timewait milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - --> - -</scenario> diff --git a/tools/sippxml/uac_register_no_cvs_400.xml b/tools/sippxml/uac_register_no_cvs_400.xml deleted file mode 100644 index ccceacdf7748bbe490cfe306222724e4dfe93c99..0000000000000000000000000000000000000000 --- a/tools/sippxml/uac_register_no_cvs_400.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-2" ?> - -<!-- Use with CSV file struct like: 3000;192.168.1.106;[authentication username=3000 password=3000]; - (user part of uri, server address, auth tag in each line) ---> - -<scenario name="register_client"> - <send retrans="500"> - <![CDATA[ - - REGISTER sip:127.0.0.1 SIP/2.0 - Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: <sip:300@127.0.0.1>;tag=[call_number] - To: <sip:400@127.0.0.1> - Call-ID: [call_id] - CSeq: [cseq] REGISTER - Contact: sip:300@[local_ip]:[local_port] - Max-Forwards: 10 - Expires: 120 - User-Agent: SIPp/Win32 - Content-Length: 0 - - ]]> - </send> - - <!-- asterisk --> - <recv response="200"> - <!-- - <action> - <ereg regexp=".*" search_in="hdr" header="Contact:" check_it="true" assign_to="1" /> - </action> - --> - </recv> - - <!-- - <recv request="INVITE" crlf="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 180 Ringing - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <send retrans="500"> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[pid]SIPpTag01[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Type: application/sdp - Content-Length: [len] - - v=0 - o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] - s=- - c=IN IP[media_ip_type] [media_ip] - t=0 0 - m=audio [media_port] RTP/AVP 0 - a=rtpmap:0 PCMU/8000 - - ]]> - </send> - - <recv request="ACK" - optional="true" - rtd="true" - crlf="true"> - </recv> - - <recv request="BYE"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:[local_ip]:[local_port];transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <timewait milliseconds="4000"/> - - - <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> - - <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> - --> - -</scenario> diff --git a/tools/sippxml/uas_register_diff_contact.xml b/tools/sippxml/uas_register_diff_contact.xml deleted file mode 100644 index 3e74a7ba4cc14fed2d01961c4b808395aade7428..0000000000000000000000000000000000000000 --- a/tools/sippxml/uas_register_diff_contact.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-2" ?> -<!DOCTYPE scenario SYSTEM "sipp.dtd"> - -<scenario name="UAS REGISTER + SUBSCRIBE/noresource"> - <!-- By adding rrs="true" (Record Route Sets), the route sets --> - <!-- are saved and used for following messages sent. Useful to test --> - <!-- against stateful SIP proxies/B2BUAs. --> - <recv request="REGISTER" crlf="true"> - </recv> - - <!-- The '[last_*]' keyword is replaced automatically by the --> - <!-- specified header if it was present in the last message received --> - <!-- (except if it was a retransmission). If the header was not --> - <!-- present or if no message has been received, the '[last_*]' --> - <!-- keyword is discarded, and all bytes until the end of the line --> - <!-- are also discarded. --> - <!-- --> - <!-- If the specified header was present several times in the --> - <!-- message, all occurences are concatenated (CRLF seperated) --> - <!-- to be used in place of the '[last_*]' keyword. --> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:127.0.0.50:5060;transport=[transport]> - Content-Length: 0 - - ]]> - </send> - - <recv request="REGISTER" crl="true"> - </recv> - - <send> - <![CDATA[ - - SIP/2.0 200 OK - [last_Via:] - [last_From:] - [last_To:];tag=[call_number] - [last_Call-ID:] - [last_CSeq:] - Contact: <sip:sip:127.0.0.50:5060;transport=[transport]> - Content-Length: 0 - ]]> - </send> - -</scenario> - diff --git a/tools/sippxml/voice b/tools/sippxml/voice deleted file mode 100644 index c881cf2d1b97c326d0f5d78ad4beebde51bd4b15..0000000000000000000000000000000000000000 Binary files a/tools/sippxml/voice and /dev/null differ