In many of my Perl projects, both personal ones, CPAN modules and work projects, I write code which tests to see whether a module has DWIMmed with respect to file creation: the file names, their paths and their content.

When the files are on my own box or on a server to which I have full privileges, there's no problem doing this.

But now I need to test whether code I write on one server properly creates directories and files on other servers which I can normally access only via SSHing to them. Moreover, once having SSHed to those servers, I often have to sudo to a special user to, for example, delete test files once my code has created them.

Right now I'm doing a lot of this manually, but it would be far more efficient and precise if I could automate the process within a test script.

I'm sure TMTOWTDI applies here. What are the ways other Monks have approached this problem? TIA.

Jim Keenan

In reply to Testing the creation of new files over SSH connection by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.