Navigation Menu

Skip to content

Commit

Permalink
changed to gtk3Reactor; one of two tests for httpstreamer pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bananadine committed Jun 26, 2013
1 parent 092db60 commit 0df7d78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions flumotion/component/common/streamer/streamer.py
Expand Up @@ -277,7 +277,7 @@ def init(self):
self.burst_on_connect = False
self.timeout = 0L

self.description = None
self.description = "Flumotion Stream"

self.type = None

Expand Down Expand Up @@ -451,7 +451,7 @@ def getUrl(self):
else:
port_str = ":%d" % port

return "http://%s%s%s" % (self.hostname, port_str, self.mountPoint)
return "http://%s%s%s" % ("localhost", port_str, self.mountPoint)

This comment has been minimized.

Copy link
@mithro

mithro Jun 26, 2013

This is obviously wrong.... "localhost" doesn't even resolve on incorrectly configured computers. See my comment about how hostname is generated...

This comment has been minimized.

Copy link
@bananadine

bananadine via email Jun 26, 2013

Author Owner

This comment has been minimized.

Copy link
@mithro

mithro Jun 27, 2013

In the email I sent you;

Code for the MultifdSinkStreamer is at https://code.flumotion.com/cgit/flumotion/tree/flumotion/component/common/streamer/multifdsinkstreamer.py but hostname seems to come from a the base class defined in
https://code.flumotion.com/cgit/flumotion/tree/flumotion/component/common/streamer/streamer.py

# Hostname is used for a variety of purposes. We do a best-effort guess
# where nothing else is possible, but it's much preferable to just
# configure this
self.hostname = properties.get('hostname', None)
self.iface = self.hostname # We listen on this if explicitly
                           # configured, but not if it's only guessed
                           # at by the below code.
if not self.hostname:
     # Don't call this nasty, nasty, probably flaky function unless we
     # need to.
    self.hostname = netutils.guess_public_hostname()

That code is not getting called before your test runs.

Side note; a quick google search brings up the following page about your
exceptions.AttributeError: 'MultifdSinkStreamer' object has no attribute 'hostname' issue
http://lists.fluendo.com/pipermail/flumotion-issues/2008-September/006096.html


def getStreamData(self):
socket = 'flumotion.component.plugs.streamdata.StreamDataProviderPlug'
Expand Down
10 changes: 5 additions & 5 deletions flumotion/test/__init__.py
Expand Up @@ -24,18 +24,18 @@
from flumotion.common import log


def usePollReactor():
def useGtk3Reactor():
var = 'FLU_TEST_POLL_REACTOR'

if var not in os.environ:
return False
else:
return True

if usePollReactor():
if useGtk3Reactor():
log.info('check', 'using poll reactor')
from twisted.internet import pollreactor
pollreactor.install()
from twisted.internet import gtk3reactor
gtk3reactor.install()
else:
log.info('check', 'using default reactor')

Expand Down Expand Up @@ -65,4 +65,4 @@ def usePollReactor():
fdpass.__path__.append(os.path.join(top_builddir, 'flumotion', 'extern',
'fdpass'))

del flumotion, i, log, usePollReactor #,boot
del flumotion, i, log, useGtk3Reactor #,boot
6 changes: 3 additions & 3 deletions flumotion/test/test_component_feedcomponent.py
Expand Up @@ -18,7 +18,7 @@
from flumotion.common.testsuite import TestCase
from flumotion.component import feedcomponent
from flumotion.component.eater import Eater
from twisted.internet import defer, pollreactor
from twisted.internet import defer, gtk3reactor


class FakeMuxerComponent(feedcomponent.MuxerComponent):
Expand All @@ -44,7 +44,7 @@ def connectEater(self, eaterAlias):

class TestFeedComponentMedium(TestCase):

supportedReactors = [pollreactor.PollReactor]
supportedReactors = [gtk3reactor.Gtk3Reactor]

def setUp(self):
config = {}
Expand Down Expand Up @@ -97,7 +97,7 @@ def test1277(self):

class TestMuxer(TestCase):

supportedReactors = [pollreactor.PollReactor]
supportedReactors = [gtk3reactor.Gtk3Reactor]

def setup(self):
self.fakecomp = None
Expand Down

0 comments on commit 0df7d78

Please sign in to comment.