Exemple #1
0
 def _sig_dc_conf(self, topo_id, base):
     self.dc_conf['services']['scion_sig_%s' % topo_id.file_fmt()] = {
         'image':
         'scion_sig_acceptance:latest',
         'container_name':
         'scion_%ssig_%s' % (self.prefix, topo_id.file_fmt()),
         'depends_on': [
             'scion_disp_sig_%s' % topo_id.file_fmt(),
             sciond_svc_name(topo_id)
         ],
         'cap_add': ['NET_ADMIN'],
         'privileged':
         True,
         'environment': {
             'SU_EXEC_USERSPEC': self.user_spec,
         },
         'volumes': [
             *DOCKER_USR_VOL,
             self._disp_vol(topo_id),
             'vol_scion_%ssciond_%s:/run/shm/sciond:rw' %
             (self.prefix, topo_id.file_fmt()), '/dev/net/tun:/dev/net/tun',
             '%s/sig%s:/share/conf' % (base, topo_id.file_fmt()),
             self._logs_vol()
         ],
         'network_mode':
         'service:scion_disp_sig_%s' % topo_id.file_fmt(),
         'command': [remote_nets(self.args.networks, topo_id)]
     }
Exemple #2
0
 def _test_conf(self, topo_id):
     docker = 'docker_' if self.args.in_docker else ''
     cntr_base = '/home/scion/go/src/github.com/scionproto/scion'
     name = 'tester_%s' % topo_id.file_fmt()
     entry = {
         'image': docker_image(self.args, 'tester'),
         'container_name': 'tester_%s%s' % (docker, topo_id.file_fmt()),
         'privileged': True,
         'entrypoint': './tester.sh',
         'environment': {},
         'volumes': [
             'vol_scion_%sdisp_%s:/run/shm/dispatcher:rw' % (docker, topo_id.file_fmt()),
             'vol_scion_%ssciond_%s:/run/shm/sciond:rw' % (docker, topo_id.file_fmt()),
             self.output_base + '/logs:' + cntr_base + '/logs:rw',
             self.output_base + '/gen:' + cntr_base + '/gen:rw',
             self.output_base + '/gen-certs:' + cntr_base + '/gen-certs:rw'
         ],
         'networks': {}
     }
     if self.args.sig:
         # If the tester container needs to communicate to the SIG, it needs the SIG_IP and
         # REMOTE_NETS which are the remote subnets that need to be routed through the SIG.
         # net information for the connected SIG
         sig_net = self.args.networks['sig%s' % topo_id.file_fmt()][0]
         net = self.args.networks[name][0]
         bridge = self.args.bridges[net['net']]
         entry['networks'][bridge] = {'ipv4_address': str(net['ipv4'])}
         entry['environment']['SIG_IP'] = str(sig_net['ipv4'])
         entry['environment']['REMOTE_NETS'] = remote_nets(self.args.networks, topo_id)
     self.dc_conf['services'][name] = entry
Exemple #3
0
 def _test_conf(self, topo_id):
     cntr_base = '/share'
     name = 'tester_%s' % topo_id.file_fmt()
     entry = {
         'image':
         docker_image(self.args, 'tester'),
         'container_name':
         'tester_%s' % topo_id.file_fmt(),
         'depends_on': ['scion_disp_%s' % name],
         'privileged':
         True,
         'entrypoint':
         'sh tester.sh',
         'environment': {},
         # 'user': self.user,
         'volumes': [
             'vol_scion_disp_%s:/run/shm/dispatcher:rw' % name,
             self.output_base + '/logs:' + cntr_base + '/logs:rw',
             self.output_base + '/gen:' + cntr_base + '/gen:rw',
             self.output_base + '/gen-certs:' + cntr_base + '/gen-certs:rw'
         ],
         'network_mode':
         'service:scion_disp_%s' % name,
     }
     net = self.args.networks[name][0]
     ipv = 'ipv4'
     if ipv not in net:
         ipv = 'ipv6'
     disp_net = self.args.networks[name][0]
     entry['environment']['SCION_LOCAL_ADDR'] = str(disp_net[ipv])
     sciond_net = self.args.networks['sd%s' % topo_id.file_fmt()][0]
     if ipv == 'ipv4':
         entry['environment']['SCION_DAEMON'] = '%s:30255' % sciond_net[ipv]
     else:
         entry['environment'][
             'SCION_DAEMON'] = '[%s]:30255' % sciond_net[ipv]
     if self.args.sig:
         # If the tester container needs to communicate to the SIG, it needs the SIG_IP and
         # REMOTE_NETS which are the remote subnets that need to be routed through the SIG.
         # net information for the connected SIG
         sig_net = self.args.networks['sig%s' % topo_id.file_fmt()][0]
         entry['environment']['SIG_IP'] = str(sig_net[ipv])
         entry['environment']['REMOTE_NETS'] = remote_nets(
             self.args.networks, topo_id)
     self.dc_conf['services'][name] = entry