#######################################################
#
# Tries to copy using the "classic" protocol, from a server that has
# "allowlegacyconnects" open.
#
# It should succeed.
#
#######################################################

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

      # FORCE CLASSIC PROTOCOL
      protocol_version => "classic";
}

bundle agent init
{
}

bundle agent test
{
  files:
      # Copy from server with allowlegacyconnects open.
      "$(G.testdir)/destfile1"
          copy_from => dcs_remote_cp("simple_source", "127.0.0.1", "9890"),
          classes   => classes_generic("copy1");
}

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

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

  reports:

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