Commit f010f4cf authored by garciay's avatar garciay
Browse files

Dockerfile: useradd issue fixed

parent 693f36f1
Loading
Loading
Loading
Loading
+58 −1
Original line number Diff line number Diff line
@@ -172,6 +172,17 @@ int sip_codec_request::encode_request_headers(const LibSip__SIPTypesAndValues::M
  osip_free(hvalue);

  // Decode Optional fields
  osip_authorization_t* authorization_header = nullptr;
  if (encode_authorization_header(p_msg_header.authorization(), &authorization_header) == -1) {
    loggers::get_instance().warning("sip_codec_request::encode_request_headers: Faile to encode Authorization header");
    return -1;
  }
  int result = ::osip_authorization_to_str(authorization_header, &hvalue);
  loggers::get_instance().log("sip_codec_request::encode_request_headers: Authorization:%s - %d", hvalue, result);
  ::osip_message_set_authorization(p_sip_message, hvalue);
  ::osip_authorization_free(authorization_header);
  osip_free(hvalue);

  osip_cseq_t* cseq_header = nullptr;
  if (encode_c_seq_header(p_msg_header.cSeq(), &cseq_header) == -1) {
    loggers::get_instance().warning("sip_codec_request::encode_request_headers: Faile to encode CSeq header");
@@ -287,6 +298,53 @@ void sip_codec_request::encode_host_port(const LibSip__SIPTypesAndValues::HostPo
  loggers::get_instance().log("sip_codec_request::encode_port_port: port:'%s'", p_port.c_str());
} // End of method encode_host_port

int sip_codec_request::encode_authorization_header(const LibSip__SIPTypesAndValues::Authorization& p_authorization, osip_authorization_t** p_authorization_header)
{
  loggers::get_instance().log(">>> sip_codec_request::encode_authorization_header");
  
  ::osip_authorization_init(p_authorization_header);

  const LibSip__SIPTypesAndValues::CredentialsList& l = p_authorization.body();
  int i = 0;
  do {
    loggers::get_instance().log("sip_codec_request::encode_authorization_header: Processing item #%d", i);
    const LibSip__SIPTypesAndValues::Credentials& c = l[i++];
    if (c.ischosen(LibSip__SIPTypesAndValues::Credentials::ALT_digestResponse)) {
      const LibSip__Common::CommaParam__List& p = c.digestResponse();
      if (p.lengthof() > 0) {
        loggers::get_instance().log_msg("sip_codec_request::encode_authorization_header: Processing param ", p);
        int j = 0;
        do {
          const LibSip__Common::GenericParam& g = p[j++];
          std::string str(static_cast<const char*>(g.id()));
          if (str.compare("Realm") == 0) {
            loggers::get_instance().log("sip_codec_request::encode_authorization_header: Realm found");
            if (g.paramValue().is_present()) {
              const LibSip__Common::GenValue& v = static_cast<const LibSip__Common::GenValue&>(*g.paramValue().get_opt_value());
              loggers::get_instance().log_msg("sip_codec_request::encode_authorization_header: GenValue: ", v);
              if (v.ischosen(LibSip__Common::GenValue::ALT_tokenOrHost)) {
                loggers::get_instance().log_msg("sip_codec_request::encode_authorization_header: tokenOrHost: ", v.tokenOrHost());
                ::osip_authorization_set_realm(*p_authorization_header, (char*)::strdup(static_cast<const char*>(v.tokenOrHost())));
              } else {
                loggers::get_instance().error("sip_codec_request::encode_authorization_header: Not implemented");
              }
            } else {
              loggers::get_instance().error("sip_codec_request::encode_authorization_header: Not implemented");
            }
          } else {
            loggers::get_instance().error("sip_codec_request::encode_authorization_header: Not implemented");
          }
        } while (j < p.lengthof());
      }
    } else {
      const LibSip__SIPTypesAndValues::OtherAuth& o = c.otherResponse();
      loggers::get_instance().error("sip_codec_request::encode_authorization_header: Not implemented");
    }
  } while (i < l.lengthof());
  
  return 0;
} // End of method encode_authorization_header

int sip_codec_request::encode_c_seq_header(const LibSip__SIPTypesAndValues::CSeq& p_c_seq, osip_cseq_t** p_c_seq_header)
{
  loggers::get_instance().log(">>> sip_codec_request::encode_c_seq_header");
@@ -298,7 +356,6 @@ int sip_codec_request::encode_c_seq_header(const LibSip__SIPTypesAndValues::CSeq
  return 0;
} // End of method encode_c_seq_header


int sip_codec_request::encode_from_header(const LibSip__SIPTypesAndValues::From& p_from, osip_from_t** p_from_header) {
  loggers::get_instance().log(">>> sip_codec_request::encode_from_header");
  
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ private: //! \todo Move this section into a sip_codec_helper class, need to deco
  int encode_request_headers(const LibSip__SIPTypesAndValues::MessageHeader& p_msg_header, osip_message_t* p_sip_message);
  int encode_request_message_body(const LibSip__MessageBodyTypes::MessageBody& p_message_body, osip_message_t* p_sip_message);
  int encode_request_payload(const LibSip__SIPTypesAndValues::Payload& p_payload, osip_message_t* p_sip_message);
  int encode_authorization_header(const LibSip__SIPTypesAndValues::Authorization& p_authorization, osip_authorization_t** p_authorization_header);
  int encode_c_seq_header(const LibSip__SIPTypesAndValues::CSeq& p_c_seq, osip_cseq_t** p_c_seq_header);
  int encode_from_header(const LibSip__SIPTypesAndValues::From& p_from, osip_from_t** p_from_header);
  int encode_max_forwards_header(const  OPTIONAL<LibSip__SIPTypesAndValues::MaxForwards>& p_max_forwards, osip_message_t** p_sip_message);
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
RUN echo "docker-titan-STF549" > /etc/hostname \
    && echo "root:etsi" | chpasswd

RUN useradd --create-home --shell /bin/bash --groups sudo etsi \
RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo

+16 −13
Original line number Diff line number Diff line
@@ -3,20 +3,20 @@

LibCommon_Time.PX_TAC := 30.0

LibItsHttp_Pics.PICS_HEADER_HOST := "e4iutdpic5.execute-api.eu-central-1.amazonaws.com"
#LibItsHttp_Pics.PICS_HEADER_HOST := "ecrf-service.azurewebsites.net"
#LibItsHttp_Pics.PICS_HEADER_HOST := "e4iutdpic5.execute-api.eu-central-1.amazonaws.com" # Used for LIS
LibItsHttp_Pics.PICS_HEADER_HOST := "6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com" # Used for ECRF
#LibItsHttp_Pics.PICS_HEADER_HOST := "ptsv2.com"

LibNg112_Pics.PICS_LIS_URI := "/Prod";
#LibNg112_Pics.PICS_ECRF_URI := "/api/lost";
#LibNg112_Pics.PICS_LIS_URI := "/Prod";
LibNg112_Pics.PICS_ECRF_URI := "/Prod";

LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8";
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8";
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8";
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8";

#LibNg112_Pics.PICS_HTTP_GET_REQUEST := false

LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567891</uri>" # Circle location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567891</uri>" # Circle location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567892</uri>" # Civic location
LibNg112_Pixits.PX_DEVICE_NUMBER_POINT := { 43.616891, 7.053179 }
LibNg112_Pixits.PX_CIRCLE_POS := { 43.617174, 7.05275 }
@@ -38,9 +38,12 @@ LogEventTypes:= Yes

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=location-information-service.azurewebsites.net,port=80,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=e4iutdpic5.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=www.googl.com,use_ssl=1)"

# LIS
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=e4iutdpic5.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
# ECRF
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
# Test
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ptsv2.com,port=80,use_ssl=0)"

#system.SIPP.params := "SIP/UDP(dst_ip=192.168.1.250,dst_port=5060,src_ip=192.168.1.253,src_port=5060)/ETH(mac_src=080027d2b658,mac_dst=90fd61e61902,eth_type=0800)/PCAP(mac_src=080027d2b658,nic=eth1,filter=and udp port 12345)"
@@ -68,7 +71,7 @@ system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debu

[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_02
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_04
@@ -76,7 +79,7 @@ AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

# Debug mode
#set -e
set -vx
#set -vx

# Usage: sudo ./merge_emcom_project.bash
# TODO Use git clone in temporary directory