For all of the test cases I ran the directory was already there.  So - the case where the directory does not exist and needs to be created was never tested.  I can update the tests to use /mnt/ephemeral/swap/swapfile to ensure that the directory does not exist and must be created.