#######################################################
#
# Tries to copy using TLS 1.3, from two servers:
# - one not supporting TLS 1.3
# - one with the defaults
#
#######################################################

body common control
{
      inputs => { "../../default.sub.cf" };
      bundlesequence  => { default("$(this.promise_filename)") };

      # Require TLS 1.3
      tls_min_version => "1.3";
}

bundle agent init
{
}

bundle agent test
{
  files:
      # Server not supporting TLS 1.3
      "$(G.testdir)/destfile1"
          copy_from => dcs_remote_cp("simple_source", "127.0.0.1", "9895"),
          classes => classes_generic("copy1");
      # Server with default "allowciphers" and "allowtlsversion"
      "$(G.testdir)/destfile2"
          copy_from => dcs_remote_cp("simple_source", "127.0.0.1", "9889"),
          classes => classes_generic("copy2");
}

#######################################################

bundle agent check
{
  classes:
      "dummy"   expression => regextract("(.*)\.sub", $(this.promise_filename), "fn");
      "exists1" expression => fileexists("$(G.testdir)/destfile1");
      "exists2" expression => fileexists("$(G.testdir)/destfile2");

  reports:

    (copy1_failed.copy2_repaired).(!exists1.exists2)::
      "$(fn[1]) Pass";
}
