Ejemplo n.º 1
0
    def _RunUpdateFlow(self, client_id):
        # Get the flows that should have been started and finish them.
        with self.ACLChecksDisabled():
            fd = aff4.FACTORY.Open(client_id.Add("flows"), token=self.token)
            flows = list(fd.ListChildren())

            gui_test_lib.CreateFileVersion(client_id.Add("fs/os/c/a.txt"),
                                           "Hello World",
                                           timestamp=gui_test_lib.TIME_0,
                                           token=self.token)
            gui_test_lib.CreateFolder(client_id.Add("fs/os/c/TestFolder"),
                                      timestamp=gui_test_lib.TIME_0,
                                      token=self.token)
            gui_test_lib.CreateFolder(
                client_id.Add("fs/os/c/bin/TestBinFolder"),
                timestamp=gui_test_lib.TIME_0,
                token=self.token)

            client_mock = action_mocks.ActionMock()
            for flow_urn in flows:
                for _ in test_lib.TestFlowHelper(flow_urn,
                                                 client_mock,
                                                 client_id=client_id,
                                                 token=self.token,
                                                 check_flow_errors=False):
                    pass
Ejemplo n.º 2
0
    def testUrlSensitiveCharactersAreShownInTree(self):
        with self.ACLChecksDisabled():
            gui_test_lib.CreateFileVersion(
                "aff4:/C.0000000000000001/fs/os/c/foo?bar&oh/a&=?b.txt",
                "Hello World",
                timestamp=gui_test_lib.TIME_1,
                token=self.token)

        # Open VFS view for client 1 on a specific location.
        self.Open(
            "/#c=C.0000000000000001&main=VirtualFileSystemView&t=_fs-os-c")

        # Wait until the folder gets selected and its information displayed in
        # the details pane.
        self.WaitUntil(self.IsTextPresent, "C.0000000000000001/fs/os/c")

        # Click on the "foo?bar&oh" subfolder.
        self.Click("css=#_fs-os-c-foo_3Fbar_26oh a:visible")

        # Some more unicode testing.
        self.Click(u"css=tr:contains(\"a&=?b.txt\")")
        self.Click("css=li[heading=Download]")

        self.WaitUntil(self.IsTextPresent, u"a&=?b.txt")

        # Test the text viewer.
        self.Click("css=li[heading=TextView]")
        self.WaitUntilContains("Hello World", self.GetText,
                               "css=div.monospace pre")
Ejemplo n.º 3
0
  def testFolderPathCanContainUrlSensitiveCharacters(self):
    with self.ACLChecksDisabled():
      gui_test_lib.CreateFileVersion(
          "aff4:/C.0000000000000001/fs/os/c/foo?bar&oh/a&=?b.txt",
          "Hello World",
          timestamp=gui_test_lib.TIME_1,
          token=self.token)

    # Open VFS view for client 1 on a location containing unicode characters.
    self.Open("/#c=C.0000000000000001&main=VirtualFileSystemView&t=_fs-os-c"
              "-foo_3Fbar_26oh")

    # Check that the correct file is listed.
    self.WaitUntil(self.IsElementPresent, "css=tr:contains(\"a&=?b.txt\")")