(self)
| 340 | ] |
| 341 | |
| 342 | def write(self): |
| 343 | # Create a dir with a striped layout set on it |
| 344 | self._mount.run_shell(["mkdir", "stripey"]) |
| 345 | |
| 346 | self._mount.setfattr("./stripey", "ceph.dir.layout", |
| 347 | "stripe_unit={ss} stripe_count={sc} object_size={os} pool={pool}".format( |
| 348 | ss=self.ss, os=self.os, sc=self.sc, pool=self.pool |
| 349 | )) |
| 350 | |
| 351 | # Write files, then flush metadata so that its layout gets written into an xattr |
| 352 | for i, n_bytes in enumerate(self.interesting_sizes): |
| 353 | self._mount.write_test_pattern("stripey/flushed_file_{0}".format(i), n_bytes) |
| 354 | # This is really just validating the validator |
| 355 | self._mount.validate_test_pattern("stripey/flushed_file_{0}".format(i), n_bytes) |
| 356 | self._filesystem.mds_asok(["flush", "journal"]) |
| 357 | |
| 358 | # Write another file in the same way, but this time don't flush the metadata, |
| 359 | # so that it won't have the layout xattr |
| 360 | self._mount.write_test_pattern("stripey/unflushed_file", 1024 * 512) |
| 361 | self._mount.validate_test_pattern("stripey/unflushed_file", 1024 * 512) |
| 362 | |
| 363 | self._initial_state = { |
| 364 | "unflushed_ino": self._mount.path_to_ino("stripey/unflushed_file") |
| 365 | } |
| 366 | |
| 367 | def flush(self): |
| 368 | # Pass because we already selectively flushed during write |
nothing calls this directly
no test coverage detected