Re: anomaly in dealing with SharedDomains


Mike Youngstrom <youngm@...>
 

On Thu, Aug 6, 2015 at 6:08 PM, Nima Kaviani <nima.kaviani(a)gmail.com> wrote:

yes, I think the issue is with the validate method in private_domain.rb
excluding shared domains prior to doing the validation, which results in
the first test in the above to not fail.

On Thu, Aug 6, 2015 at 5:01 PM, Mike Youngstrom <youngm(a)gmail.com> wrote:

I think it is a bug.

The intended functionality is that a sub domain of a shared domain can be
made private. But if the domain currently exists, private or shared
doesn't matter, should fail.

Mike

On Thu, Aug 6, 2015 at 5:43 PM, Nima Kaviani <nima.kaviani(a)gmail.com>
wrote:

Hi,

I am trying to understand the expected behaviour when an already
existing SharedDomain is redefined as either a shared or a private domain
in CloudController.

I have added the following test to *domain_validation.rb ... *note the
validation part of the test which is highlighted. The following test does
not pass in *private_domain_spec.rb* but it does pass for
*shared_domain_spec.rb.*

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.not_to be_valid }*
*end*

Now if I change the test to the following it passes in
*private_domain_spec.rb* but it does not pass in* shared_domain_spec.rb*
.

*context 'when the domains are exact match and it is already a shared
domain' do*
* before do*
* SharedDomain.make name: 'foo.com <http://foo.com>'*
* subject.name <http://subject.name> = 'foo.com <http://foo.com>'*
* end*
* it { is_expected.to <http://is_expected.to> be_valid }*
*end*

so, what is the expected behaviour with regards to an already existing
SharedDomain? does it allow for private domains to take over the name but
not for other SharedDomains to not take over the name, or vice verse? or is
it a bug in the way domain names get validated?

thanks,
-nima


--
http://nima.magic.ubc.ca

--
http://nima.magic.ubc.ca

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.