#! /usr/bin/env perl
##**************************************************************
##
## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
## University of Wisconsin-Madison, WI.
## 
## Licensed under the Apache License, Version 2.0 (the "License"); you
## may not use this file except in compliance with the License.  You may
## obtain a copy of the License at
## 
##    http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
##**************************************************************

use CondorTest;
use Check::SimpleJob;
use Check::CondorLog;

#testreq: personal
my $config = <<CONDOR_TESTREQ_CONFIG;
  # test with submit daemons using CCB
  SCHEDD.CCB_ADDRESS = $(COLLECTOR_HOST)
  SHADOW.CCB_ADDRESS = $(COLLECTOR_HOST)
  DAEMON_LIST = MASTER, COLLECTOR, NEGOTIATOR, STARTD, SCHEDD

  # all daemons with same private network name
  PRIVATE_NETWORK_NAME = MyPrivateNet

  COLLECTOR_DEBUG = $(COLLECTOR_DEBUG) D_FULLDEBUG

  USE_SHARED_PORT = FALSE
CONDOR_TESTREQ_CONFIG
#endtestreq

# verify that a job runs
# Turn on file transfer, because there was once a problem with
# file transfer not respecting private network settings.
SimpleJob::RunCheck(
    should_transfer_files => "yes",
    when_to_transfer_output => "on_exit",
);

# verify that no connections were made via CCB
# (Because everything has same private network name)
CondorLog::RunCheck(
    daemon => "COLLECTOR",
    match_regexp => "CCB: received 'success' from target daemon",
    fail_if_found => 1
);

CondorTest::EndTest();
