From 539f39680436dfebe6de9e5c8b905428af438468 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Mar 2009 14:18:53 -0700 Subject: mysql: filter out URLs for down/dead hosts/devices Clients won't be able to make use of them if they're down or dead. We trust the MogileFS metadata in MySQL to be synced correctly with the actual device/host states. --- test/setup.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/setup.rb') diff --git a/test/setup.rb b/test/setup.rb index a7406f2..02b67d2 100644 --- a/test/setup.rb +++ b/test/setup.rb @@ -109,11 +109,13 @@ end class FakeMysql attr_reader :expect TBL_DEVICES = [ - # devid, hostip, altip, http_port, http_get_port - [ 1, '10.0.0.1', '192.168.0.1', 7500, 7600 ], - [ 2, '10.0.0.2', '192.168.0.2', 7500, 7600 ], - [ 3, '10.0.0.3', nil, 7500, nil ], - [ 4, '10.0.0.4', nil, 7500, nil ], + # devid, hostip, altip, http_port, http_get_port, dev status, host status + [ 1, '10.0.0.1', '192.168.0.1', 7500, 7600, 'readonly', 'alive' ], + [ 2, '10.0.0.2', '192.168.0.2', 7500, 7600, 'alive', 'alive' ], + [ 3, '10.0.0.3', nil, 7500, nil, 'readonly', 'alive' ], + [ 4, '10.0.0.4', nil, 7500, nil, 'alive', 'alive' ], + [ 5, '10.0.0.5', nil, 7500, nil, 'dead', 'alive' ], + [ 6, '10.0.0.6', nil, 7500, nil, 'alive', 'down' ], ] TBL_DOMAINS = [ # dmid, namespace -- cgit v1.2.3-24-ge0c7