3 class DnsSrvDiscovererTest
extends PHPUnit_Framework_TestCase
{
5 * @covers DnsSrvDiscoverer
6 * @dataProvider provideRecords
8 public function testPickServer( $params, $expected ) {
9 $discoverer = new DnsSrvDiscoverer( '_etcd._tcp.eqiad.wmnet' );
10 $record = $discoverer->pickServer( $params );
12 $this->assertEquals( $expected, $record );
16 public static function provideRecords() {
21 'target' => 'conf1003.eqiad.wmnet',
27 'target' => 'conf1002.eqiad.wmnet',
33 'target' => 'conf1001.eqiad.wmnet',
40 'target' => 'conf1003.eqiad.wmnet',
49 'target' => 'conf1003or2.eqiad.wmnet',
55 'target' => 'conf1003or2.eqiad.wmnet',
61 'target' => 'conf1001.eqiad.wmnet',
67 'target' => 'conf1004.eqiad.wmnet',
73 'target' => 'conf1005.eqiad.wmnet',
80 'target' => 'conf1003or2.eqiad.wmnet',